PDA

View Full Version : Eurobet Email Source Code (if your use PERL)


swiftrhett
08-02-2005, 02:27 AM
I wasn't about to save all my eurobet messages to a file one by one, so I wrote a perl script that just gets them and emails them all to my gmail account. I modifyed the script a little to take out my info, so you need to put your own in if you use this.

If any of you use linux, this should be easy to set up, if you use windows, you can get this running with Activestate PERL (free).

Anyway, here is the script:
#!/usr/bin/perl

use Net::SMTP;
use Net::Config;
use WWW::Mechanize;

#Enter your EUROBET USER/PASS in the quotes

my $EUROBET_USERID='';
my $EUROBET_PASSWORD='';
#################
##
##Enter your email info below
##
my $mech = WWW::Mechanize->new();

$mech->get( 'http://www.eurobet.com/sb.go?page=index&lang=1&sid=1&ms=MS');

$mech->submit_form(
form_name => 'LoginForm',
fields => {
username => $EUROBET_USERID,
password => $EUROBET_PASSWORD,
}
);
if ($mech->content =~ /\"http\:\/\/.*?\&sid=(\d*)\&ms\=MS\"\)\;/){

$mech->get ( 'https://wp.eurobet.com/payeci.go?stage=40000&splash=1&dummy=0&mstage=1&ch annel=sb=slang=1&sid='. $1.'&ms=MS');

my @messages = $mech->content =~ m/\<a href\=(payeci\.go\?stage\=\d+\&mstage\=\d+\&sid=\d +\&lang\=1\&ms\=MS\&channel\=sb\=slang\=\d+\&msgpo s\=\d+\&msgid\=\d+\&inbox\=\d+) clas/gi;
print scalar @messages;
for my $message (@messages){
$mech->get ('https://wp.eurobet.com/' . $message);
$mech->follow_link ( text_regex =>qr/history/i);
if ($mech->content =~ /(Tournament \#\d+)/){
$subject = 'Eurobet ' . $1;
}
###ENTER EMAIL INFO HERE
###

##Your SMTP Server
$smtp=Net::SMTP->new('YOUR_SMTP_SERVER_HERE');

##Your Email "FROM" Address
$smtp->mail('youremail@yourdomain.com');

##YOUR Email "TO" Address
$smtp->to('Desinationaddress@yourdomain.com');
$smtp->data();

##ENTER Again, leave the slashes in
$smtp->datasend("From: you\@yourdomain\.com\n");
$smtp->datasend("To: youremail\@yourdomain\.com\n");
$smtp->datasend("Subject: Hand History from PartyPoker.com $subject \n");
$smtp->datasend("\n");
$smtp->datasend($mech->content);
$smtp->dataend();
$smtp->quit;
}
}

citanul
08-02-2005, 02:28 AM
can someone who cares enough to read this post tell me if this script will just send your id and passsword to the script's author?

citanul

tigerite
08-02-2005, 04:33 AM
Nah, it looks legit.

tshort
08-02-2005, 04:36 AM
Nice.

codewarrior
08-02-2005, 07:15 AM
Only if you type in the author's email addy for him. Looks good.

1C5
08-02-2005, 09:26 AM
This would be great. Can you please, please help me. I have no clue how to do this, what program I have to download (I use Windows XP) but I would be forever grateful. I waste 15 min a day copying the HH one by one onto my computer from Eurobet.

tigerite
08-02-2005, 09:45 AM
I'm going to try to knock something up to call this code, give me a little while.

1C5
08-02-2005, 09:56 AM
Ok, thanks.

Please make it simple so a computer dummy like me can do it.

tigerite
08-02-2005, 10:21 AM
ActiveState Perl doesn't come with WWW::Mechanize. Can't do it as it stands.

Ok, I found it on a web search. Back on with it.

swiftrhett
08-02-2005, 03:09 PM
One problem with making this super easy for computer boneheads is that they still need to enter an SMTP server to send the email. I use the SMTP server that comes with my cable internet.

I have made perl scripts easy to run for clients in the past by putting my script, activestate perl, and the modules in a single directory. Then I write a batch file to simply run the script, and the client can just click on the batch file icon. It's kind of a pain to set up through. Good luck, tigerite

08-02-2005, 03:23 PM
All my SNG HHs are saved to my harddrive fine. I play eurobet as well.

tigerite
08-02-2005, 04:47 PM
I've written it so that it saves to a directory instead of emailing the histories. It's done if someone can tell me a good file space to use. It's not perfect, though, doesn't update whilst it's writing tournament summaries, that kind of thing. I wrote it in AutoHotKey so if anyone wants the full source, in case they're worried it's sending the password (which it definitely isn't except to the Eurobet site) then I'll post it, it's short. You can I believe decompile it anyway.

The only thing you need to install with it is the ActiveState Perl from

http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.7.813-MSWin32-x86-148120.msi

The rest it should copy across for you, as long as you unzip it with folder structure intact.

tigerite
08-02-2005, 05:05 PM
http://www.savefile.com/files/3109063

Enjoy.

A_PLUS
08-02-2005, 05:18 PM
Awesome!

junkmail3
08-02-2005, 05:24 PM
[ QUOTE ]
It's not perfect, though, doesn't update whilst it's writing tournament summaries, that kind of thing.

[/ QUOTE ]

Does this mean that if I get another HH in my folder while the program is currently writing, it won't write the new one until I run the program again?

Also, do I have to delete old HHs from eurobet in order to prevent writing it twice?

(I haven't downloaded/read the code yet)

1C5
08-02-2005, 05:44 PM
My God, you are a genius, I just tried it and it worked!! Thank you.

Could you explain what you mean also like the guy above me posted?

I had 4 HH in my Eurobet account, tried it and it worked. Then tried it again with the same 4 and it didn't create duplicates of them which is a good thing. So it can tell the difference between new and old HH in the Eurobet website right?

Thanks agin, you just saved me hours of monkey work each month!! /images/graemlins/cool.gif

curtains
08-02-2005, 05:53 PM
hmm maybe I have to get in on this action.

1C5
08-02-2005, 05:57 PM
Do you copy them one by one as I had been doing for the past 2 months?

tigerite
08-02-2005, 09:03 PM
[ QUOTE ]
[ QUOTE ]
It's not perfect, though, doesn't update whilst it's writing tournament summaries, that kind of thing.

[/ QUOTE ]

Does this mean that if I get another HH in my folder while the program is currently writing, it won't write the new one until I run the program again?

Also, do I have to delete old HHs from eurobet in order to prevent writing it twice?

(I haven't downloaded/read the code yet)

[/ QUOTE ]

Ah.. that's not what I meant, actually it should put new ones straight in as long as they arrive before the process end, I just mean the app seems to "freeze" whilst it's doing it, and the progress bar (which I had hoped to make move along whilst it did each tourney) doesn't do anything. It's because it calls a dll to call the perl code, which locks it up. As for needing to delete, nah, it will just overwrite what's there already, so if you already have a Tournament #xxxxxxx.txt it'll just replace it, even though it's the same.

1C5
08-02-2005, 10:21 PM
Thanks again, saves so much time!!! /images/graemlins/cool.gif

junkmail3
08-02-2005, 10:45 PM
Hm, I dont' know if it's working or not.

I just unzipped it. Downloaded that perl thing. Installed it. Clicked on the green 'H', and input my information.

I have a lot of HH, so they may not show up until they are copied. But I tend to think it's not working.

What am I doing wrong? (sorry to be a bother.)

MuckedTheNuts
08-03-2005, 01:13 AM
When I try and use this I get the error "The ordinal 3212 could not be located in the dynamic link library
LIBEAY32.dll" Does anyone know how I might fix this?

tigerite
08-03-2005, 04:54 AM
[ QUOTE ]
Hm, I dont' know if it's working or not.

I just unzipped it. Downloaded that perl thing. Installed it. Clicked on the green 'H', and input my information.

I have a lot of HH, so they may not show up until they are copied. But I tend to think it's not working.

What am I doing wrong? (sorry to be a bother.)

[/ QUOTE ]

Hmm. They should show up one at a time. Are you sure your firewall isn't stopping the connection? If your CPU doesn't go high for a while, and the app instantly comes back to life, it'll mean either your username/password combo is wrong or the app can't connect to the website for some reason.

As for the ordinal question. I'm not too sure on that one. You could try to go to a command prompt (Start Menu -> Run -> cmd) then type ppm and follow the instructions here:

http://johnbokma.com/perl/https.html

(the app copies the dll's for you but it's possible it doesn't work if you're not on Win2000/XP) ?

tigerite
08-03-2005, 06:59 AM
There's one other thing I forgot, the user account that runs the program needs administrator access as it reads from the registry (this is to find out where your Perl is installed, to copy the dll's across).

DaveKForty7
08-03-2005, 03:52 PM
Could someone please explain this to me like I'm 12 because I'd love to be able to use this, but lack the know how to set it up.

MuckedTheNuts
08-07-2005, 03:19 PM
Has anyone been able to get this to work? This program would be amazing but I have not been able to get it to work.

tigerite
08-07-2005, 05:08 PM
Yeah, a few have, and it works ok on mine, I really am at a loss as to why it doesn't work on your system.

Slim Pickens
08-07-2005, 09:13 PM
I just got it working. This [censored] kicks [censored]-licking [censored] ass. Rhett, I take back most of the bad things I've ever said about you. Tigerite, I've never said anything bad about you, so we were even to start. You guys rule!

SlimP

travisand
08-08-2005, 03:38 PM
Has anyone else been able to get this to work? I seem to be having the same problem as some others of having the program shut down after a few seconds.

I think this would be a very useful thing to have if I could get it working.

thanks for the effort you put into it tigerite.

z32fanatic
08-12-2005, 03:22 PM
I downloaded it and can get the app to stay open but when I hit OK the box goes blank then comes back when it's done but the summaries are not put into the D/L folder I designated. I haven't created any new summaries since I downloaded it but there are still old ones in my internal message box. Is anyone else having similar problems?

Slim Pickens
08-12-2005, 05:30 PM
EuroGhett is, as usual, sucking ass. I can't import because the link in the message points to "Hand History not Available" or some crap like that. I'm assuming this is normal for Eurobet, yes?

shejk
08-12-2005, 06:11 PM
[ QUOTE ]
When I try and use this I get the error "The ordinal 3212 could not be located in the dynamic link library
LIBEAY32.dll" Does anyone know how I might fix this?

[/ QUOTE ]

me too

EDIT: Just saw that you answered about this, sorry

shejk
08-12-2005, 06:31 PM
[ QUOTE ]
As for the ordinal question. I'm not too sure on that one. You could try to go to a command prompt (Start Menu -> Run -> cmd) then type ppm and follow the instructions here:

http://johnbokma.com/perl/https.html

(the app copies the dll's for you but it's possible it doesn't work if you're not on Win2000/XP) ?

[/ QUOTE ]

I reinstalled the dll it complains about (same as guy above) and it still says the same thing...

Any other ideas?

(I'm on win xp, with all the updates and crap)

HesseJam
08-16-2005, 04:18 PM
[ QUOTE ]
[ QUOTE ]
Hm, I dont' know if it's working or not.

I just unzipped it. Downloaded that perl thing. Installed it. Clicked on the green 'H', and input my information.

I have a lot of HH, so they may not show up until they are copied. But I tend to think it's not working.

What am I doing wrong? (sorry to be a bother.)

[/ QUOTE ]

Hmm. They should show up one at a time. Are you sure your firewall isn't stopping the connection? If your CPU doesn't go high for a while, and the app instantly comes back to life, it'll mean either your username/password combo is wrong or the app can't connect to the website for some reason.

[/ QUOTE ]

I did everything and it seems to work since it is downloading about 2 MB of data for about 30 HHs . But they do not show up in the directory. At the start it shows a file named total.txt in the d/l directory which only contains a three digit no. After finishing with the download this file is gone as well and nothing shows in the directory.
I searched for the newest files and found some files under PCHealth which are somewhat quarantined. So it may have to do somthing with the security settings. I disabled the firewall but the result is the same.
I am lost. Can anybody help me?

Slim Pickens
08-16-2005, 04:35 PM
EuroGhett (still) sucks. Check your Eurobet internal messages and you'll probably see that you have none, or the ones you have link to "Hand History Not Available."

HesseJam
08-17-2005, 03:42 AM
Thanks for your advice. Yup, I see the headers but they "are not available".

tigerite
08-17-2005, 08:33 AM
Yeah, sorry, not much I can do about that /images/graemlins/frown.gif It only picks them up if they have "Tournament" in the text, I think (not sure how the perl works exactly - but it's along those lines). Nah, it won't add anything to PCHealth, the total.txt was just going to be for a progress bar, but I couldn't get it working. When it's deleted it means it's finished processing.

HesseJam
09-22-2005, 03:50 AM
I just wanted to bump this. I couldn't get it to work but the fault was on EuroTrash's side because at that time no e-mail bodies were available. I tried it again two days ago and KAZAAM!!! all the Summaries appeared on my harddrive.

Thank you, thank you, thank you to the original poster and to Tigerite!

lacky
09-22-2005, 05:09 AM
wow, I mean, WOW. In my next life a want the ability to create cool things that even computer idiots like me can get working.

well done guys

Steve

Position
09-22-2005, 01:39 PM
Fantastic job, tigerite! Just now tried it very successfully.