473,320 Members | 2,000 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Open URL from email message

Hi,

When reading from email message using Net::POP3 (or other means),
I need my perl program to open URLs incuded into the message. In other
words, I need the program to click links in the message.
So far I have not found the solution for that either in Net::POP3 or
anywhere else.
Does anyone have an idea how to do that?

Thanks, Lev
Jul 19 '05 #1
4 6337
Internet Explorer can be launched with the following system call:
system("start $url");
where $url is a variable where we stored URL read by Net::POP3.
But the task is to emulate a click on the link from email message. Launching
the browser is not
an issue here. I am not certain that launching the browser as I described
above will emulate
a click on the link from email message.

"Mina Naguib" <sp**@thecouch.homeip.net> wrote in message
news:XL********************@wagner.videotron.net.. .
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Lev Altshuler wrote:
Hi,

When reading from email message using Net::POP3 (or other means),
I need my perl program to open URLs incuded into the message. In other
words, I need the program to click links in the message.
So far I have not found the solution for that either in Net::POP3 or
anywhere else.
Does anyone have an idea how to do that?

Thanks, Lev
Net::POP3 handles, obviously, the POP3 protocol. In other words,

"download this chunk of text, it should resemble something parse-able by an email client as an email message".
That's all there is to it, a chunk of text in an agreed-on format.

Anything beyond that, you have to do yourself. If you expect that chunk of message to have URLs that you are interested in, then you need to extract these URLs. For simple text emails, you can probably get away with using a simple regular expression to collect the URLs. For HTML-encoded emails, you can probably use HTML::TokeParser to cleanly extract links.

Once you have the URLs (still, chunks of text) in a variable somewhere, you want to simulate a "click". In other words, you want to launch a web browser that visits these URLs.
Fortunately, perl comes with what you need. Look into any of the LWP* family of modules. For simple GET requests with no further interaction, LWP::Simple might be what you're looking for.
Best of luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/Bhh3eS99pGMif6wRAvX6AJ9SgfwHu7BoyeKvW2QXrYkr2Us7oA CglhRw
CZqJOuOT4wA+yt2t866cBic=
=Vz0g
-----END PGP SIGNATURE-----

Jul 19 '05 #2
Lev Altshuler <le****@rogers.com> wrote:

[ dejeopardized, follow-ups set to clpmisc ]
"Mina Naguib" <sp**@thecouch.homeip.net> wrote:
Lev Altshuler wrote:
I need my perl program to open URLs incuded into the message. In other
words, I need the program to click links in the message.
LWP::Simple might be what you're looking for.

Internet Explorer can be launched with the following system call:
system("start $url");
where $url is a variable where we stored URL read by Net::POP3.
But the task is to emulate a click on the link from email message.

^^^^^^^^

Isn't it a little summery for homework?
Launching the browser is not an issue here. I am not certain that
launching the browser as I described above will emulate a click on
the link from email message.


You can emulate a *click* on the link using return().

sub click {
my $thing = shift;
return;
}

This is approximately what mutt does when you click on anything,
and I think it's correct behavior.

HTH
--
Steve
Jul 19 '05 #3
"Lev Altshuler" <le****@rogers.com> writes:
Internet Explorer can be launched with the following system call:
system("start $url");
where $url is a variable where we stored URL read by Net::POP3.
But the task is to emulate a click on the link from email message. Launching
the browser is not
an issue here. I am not certain that launching the browser as I described
above will emulate
a click on the link from email message.


You know, top-posting and full-quoting like that will get a lot of
people angry with you. You won't like it when a lot of people get
angry with you. Read this page to find out how to do it so that
everybody will accept your contributions:
http://www.netmeister.org/news/learn2quote2.html

As for "emulating a click", what other actions do you think that
clicking on a link would have than to get a web browser to display
the page linked to?
--
No, YOU'RE A CRACKPOT, which is why you think I'm a crackpot...
because all crackpots like you think everybody else is a moron
not them. -- George Hammond
http://beable.com
Jul 19 '05 #4
Beable van Polasm <be************@beable.com.invalid> writes:
As for "emulating a click", what other actions do you think that
clicking on a link would have than to get a web browser to display
the page linked to?


The answer, if it's HTML mail, and javascript is enabled, is "darn
near anything". If the machine in question runs Windows, even more
so.

-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
8
by: Nils | last post by:
Hello, my problem: I merged about 1.000 Tables with Create table name (variables) type=merge union=(table1,table2,...,table1000); MySQL now creates a tables, but I can't open it....
4
by: Terry | last post by:
I have created a Main Switchboard in Access 2000 and it has a button which opens a Form. I have set the form Properties Default View to Datasheet and this always opens in datasheet view. When I...
5
by: John Warner | last post by:
I have a wierd problem that I can't find any reference to in the knowledge base. I develop simple databases at the company where I work, and many of them are used by hundreds of employees. We all...
8
by: Brian F | last post by:
Exactly what the subject says. I have an ASP page that I want my C# windows application to open in Internet Explorer, and if possible have it send along a list of values from a list box. Thank you.
5
by: Nathan Sokalski | last post by:
How do I open and change properties of (such as size, position, scroll position, visibility of toolbars, etc.) a browser window? Thanks. -- Nathan Sokalski njsokalski@hotmail.com...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
7
by: jonathandrott | last post by:
sorry newbie question probably. i'm trying to open an specific folder. open each file with in the folder individually and process each one. all the processing code has been written. i'm looking...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
23
by: andyoye | last post by:
How can I launch Outlook on users machines when they click a button on a web form (InfoPath)? Thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.