x404.co.uk http://www.x404.co.uk/forum/ |
|
strange reuest from a mate http://www.x404.co.uk/forum/viewtopic.php?f=4&t=10078 |
Page 1 of 2 |
Author: | AlunD [ Thu Aug 19, 2010 5:50 pm ] | ||||||||||||||||||
Post subject: | strange reuest from a mate | ||||||||||||||||||
I challenged him and he cam back with this
I am totally happy he is kosha. So anybody got any ideas. ![]() |
Author: | forquare1 [ Thu Aug 19, 2010 7:31 pm ] |
Post subject: | Re: strange reuest from a mate |
I'd look at something like this: http://webdesign.ittoolbox.com/groups/t ... rl-1458184 Then create a script to scrape links out... I'll take a look tomorrow. |
Author: | AlunD [ Fri Aug 20, 2010 6:10 am ] |
Post subject: | Re: strange reuest from a mate |
cheers Ben |
Author: | forquare1 [ Fri Aug 20, 2010 6:21 am ] |
Post subject: | Re: strange reuest from a mate |
Quick question, do the links need to be to a specific address, or contain specific text? i.e. should it always pick up http://www.example.com when written just like that and when it's inside a link tag, or does he just want to get <a href="www.example.com>this bit of the text</a> |
Author: | AlunD [ Fri Aug 20, 2010 6:35 am ] | |||||||||
Post subject: | Re: strange reuest from a mate | |||||||||
was his response |
Author: | Col [ Fri Aug 20, 2010 4:07 pm ] |
Post subject: | Re: strange reuest from a mate |
Hi All The link could work of either a specific address or a specific text, as the data I'll be affecting is demo/testing data I can build it as required.... ![]() |
Author: | AlunD [ Fri Aug 20, 2010 4:09 pm ] |
Post subject: | Re: strange reuest from a mate |
Just so everybody understands Col is the mate who asked the question ![]() |
Author: | forquare1 [ Fri Aug 20, 2010 4:17 pm ] |
Post subject: | Re: strange reuest from a mate |
Hi Col, I've had a bit of a hectic day and haven't been able to really look at it, that should change this evening and I hope to have something by the end of the weekend. At the moment I'm thinking you'll call the script and give it a file containing email account details and the string (link/text) you want it to look for. Do you then want the script to open that link in a browser? Or just report that it found the link/text? |
Author: | forquare1 [ Sat Aug 21, 2010 1:24 pm ] | ||||||||||||||||||
Post subject: | Re: strange reuest from a mate | ||||||||||||||||||
I have something... I have a program that reads email account information and search terms from a file then connects to the email account and searches for messages with the search term in. It then logs the total number of messages that matched the search term as well as the overall total in a separate file. The file with account information in should be called "accounts.csv" and should be in the same folder as the perl script. I chose CSV as I thought you could put all of your data in Excel/Calc and export it, which might make life easier. The results will be written to the same folder in a file called "results.csv", again CSV was chosen as you could import the results into Excel/Calc for easy viewing. To run the script you must have Perl 5.8.9 or higher (lower may work, but the the earliest I have is 5.8.9) and you must have the module Mail::IMAPClient installed for that version of Perl. On Windows you'll probably want Strawberry Perl. Installation of Strawberry Perl is really easy (I've just done it on XP). Installing modules is a little harder: open a command window (start > run > cmd > ok) and type "cpan Mail::IMAPClient" (no quotes), it should then install it for you. Your accounts.csv file should look something like this:
For example:
Download this zip file: Perl script in a zip file Save and unzip that somewhere (e.g. Desktop) as "email.pl" (no quotes). Open up a cmd window (start > run > cmd > ok) and type "cd C:\location\of\email.pl" (e.g. "cd C:\Documents and Settings\user\Desktop", no quotes) Then type "perl email.pl" You should see a file called "results.csv" appear, and in the command window you should see something like "Total count is: 10" when the script finishes. If you need it to actually click the link, reply back and I'll see what I can do :) Ben |
Author: | Col [ Sun Aug 22, 2010 8:09 am ] |
Post subject: | Re: strange reuest from a mate |
Hi Ben Thanks for this! Will take a look now! |
Author: | Col [ Sun Aug 22, 2010 8:31 am ] |
Post subject: | Re: strange reuest from a mate |
Hi Ben. Yes I need it to both open the emails and click on the links, that way the actions will show in the system. Many Thanks Col |
Author: | forquare1 [ Sun Aug 22, 2010 2:50 pm ] | ||||||||||||||||||
Post subject: | Re: strange reuest from a mate | ||||||||||||||||||
OK, this new script does exactly the same as before, but it now follows the link. You won't see a browser window pop up, but it will register on the server as someone accessing that page. You can get the script from here. To get the extra functionality I have had to use more modules. To install them, open up the command prompt and type:
Once that has finished, go here and download the module. Uncompress it (may need winzip or similar) then open up a command prompt. Type the following:
You may have to type in ".\Build" or "./Build" for the last three commands to work. Once that has installed, use this new script just like the previous one. The script looks at each account and each email in that account, it then looks at all of the URLs in the email and looks to see if one matches the search string (remember you put that in accounts.csv), if it finds a corresponding URL then it'll load it up which won't show up on your screen, but should register with the server. I have kept the counting mechanism in just incase that was useful. Give me a should if it doesn't work or you need something else, Ben |
Author: | AlunD [ Sun Aug 22, 2010 2:52 pm ] |
Post subject: | Re: strange reuest from a mate |
Very impressive Ben and thanks for Helping Col out. |
Author: | forquare1 [ Sun Aug 22, 2010 2:56 pm ] | |||||||||
Post subject: | Re: strange reuest from a mate | |||||||||
Not a problem, it's helped me do a bit more perl programming, I'm just sorry it's not a little more user friendly (i.e. a GUI app rather than a cli utility...) |
Author: | AlunD [ Sun Aug 22, 2010 2:58 pm ] | ||||||||||||||||||
Post subject: | Re: strange reuest from a mate | ||||||||||||||||||
Don't worry Colin is perfectly at home at the command line. |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |