EnergyMech

Forum | Features | Download | Addons | Help | #emech | Links | About | Contact

Versions | News Archive | Installing | Linking | Configuration | Commands | FAQ


The time is now Friday, September 22nd, 2017, 6:45pm

Create account ]   User/Pass   


Forum Index :: Generic Discussion :: Example for code to retrieve information from www :: Reply to this topic

Author
 
shao
Posted :: 8:40am, Sun, Apr 8, 2007     Subject :: Example for code to retrieve information from www


Posts: 3
 
    Hi,
I just found energy mech, installed and liked. But I'm pretty new in C lanquage
(in any lanquage that is) and was wondering if someone could give an example code of
how to add command for bot to retrieve information from internet website ie:
In channel, by typing .train 1 bot connects to
http://www.amtrak.com/servlet/ContentServer?pagename=Amtrak/Page/Routes_Index_Page&c=Page&cid=1080072922209&ssid=4
(or some web page, this is just lame example), enters train numer or such and send info about that train to irc
channel.

 
proton
Posted :: 4:30am, Wed, Apr 11, 2007


Posts: 165
 
    that is a complex task, more than a few lines of code.

 
shao
Posted :: 6:02am, Wed, Apr 11, 2007


Posts: 3
 
    Yeah that's what I thought also.
quite simple to open socket connection to certain port to certain sever,
but getting right stuff from there is quite hard. I think especially stability
is the problem there..
I might have to go back to Python, because in python it's quite easy to do and I
almost have re4ady script for it (not tested tho =) ).
This pisses me off, I really like emech's code, but on the other hand, really need
to make that socket thingy working and I don't have skills to do it...
- Should save coding to those who know how to do it =) -

 
proton
Posted :: 11:22am, Wed, Apr 11, 2007


Posts: 165
 
    opening a socket is easy enough, doing it without freezing the entire bot is the hard part
i even put a small experimental web server in the mech but never made anything out of it


 
shao
Posted :: 11:35am, Wed, Apr 11, 2007


Posts: 3
 
    Any ideas of how hard it will be to sink some python code to emech?
Make Python part handle www discussions and core bot running on C?

 
proton
Posted :: 12:45pm, Wed, Apr 11, 2007


Posts: 165
 
    nope, no idea, never touched python


 

Copyright © 2000-2005 Proton,  All rights reserved. Last edited August 16th, 2005.
HTML 4.01 CSS