Reply
Thread Tools
jaeezzy's Avatar
Posts: 664 | Thanked: 160 times | Joined on Jul 2008 @ Australia
#1
Hi, I'm in Australia and was wondering if anyone can suggest me as to how I can access data from the server which some web page is using to provide information. To be specific, I want to write an app for a cityrail in australia but couldn't figureout as to where to start. Thanks
 

The Following User Says Thank You to jaeezzy For This Useful Post:
Posts: 69 | Thanked: 55 times | Joined on Nov 2009
#2
Originally Posted by jaeezzy View Post
Hi, I'm in Australia and was wondering if anyone can suggest me as to how I can access data from the server which some web page is using to provide information. To be specific, I want to write an app for a cityrail in australia but couldn't figureout as to where to start. Thanks
Take a look a the wget source code, there you can find plenty of inspiration.

PS.: also the busybox wget applet should do it if you like it more compact.
 
jaeezzy's Avatar
Posts: 664 | Thanked: 160 times | Joined on Jul 2008 @ Australia
#3
@farmatito: thanks for the reply, I'll be looking through them. However, I had the impression that provider of such services via internet have a particular API to interact with their data server, don't they? like facebook etc.. thanks
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#4
Originally Posted by jaeezzy View Post
@farmatito: thanks for the reply, I'll be looking through them. However, I had the impression that provider of such services via internet have a particular API to interact with their data server, don't they? like facebook etc.. thanks
Some sites supply a specialized API to get or send information via their web server(s), not all.

In many cases you are forced to download the HTML, parse it (in one of several ways), extract the information you're looking for and use that. This is sometimes called "site scraping".

To supply information, via forms, you need to create the specific GET or POST request and simulate entering data into a form and clicking the "Send" button.
 

The Following User Says Thank You to Joorin For This Useful Post:
jaeezzy's Avatar
Posts: 664 | Thanked: 160 times | Joined on Jul 2008 @ Australia
#5
Hi joorin thanks for the reply. if you can suggest me some good guides on this would be great, as its completely new thing for me, however I'm doing my part of googling as well . thanks
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#6
Have a go with libcurl, it's pretty basic but has some special features:

http://curl.haxx.se/libcurl/c/example.html

You'll find an example with HTML parsing too, using libxml.
 

The Following User Says Thank You to Joorin For This Useful Post:
Posts: 56 | Thanked: 31 times | Joined on Jul 2008 @ Austria
#7
jaeezzy:
in C:
to fetch data from a HTTP server, use libcurl.
To use XML-RPC, use libsoup (<http://library.gnome.org/devel/libsoup/stable/libsoup-24-XMLRPC-Support.html>).
To automate HTML forms, use libsoup (<http://library.gnome.org/devel/libsoup/stable/libsoup-2.4-HTML-Form-Support.html>).

or if you use Python:
just use urllib, BeautifulSoup and xmlrpclib (<http://www.crummy.com/software/BeautifulSoup/>) (simpler to use than the above).
 

The Following User Says Thank You to dannym For This Useful Post:
Posts: 8 | Thanked: 1 time | Joined on Oct 2010 @ Sevilla
#8
Originally Posted by jaeezzy View Post
Hi, I'm in Australia and was wondering if anyone can suggest me as to how I can access data from the server which some web page is using to provide information. To be specific, I want to write an app for a cityrail in australia but couldn't figureout as to where to start. Thanks
How are you doing in your project you talk about here?, i want to do something similar and i'd be very happy if you could share any information...
 
Posts: 3,464 | Thanked: 5,107 times | Joined on Feb 2010 @ Gothenburg in Sweden
#9
Originally Posted by farmatito View Post
Take a look a the wget source code, there you can find plenty of inspiration.

PS.: also the busybox wget applet should do it if you like it more compact.
if you dont must go with gtk use QT instead and qtnetworkmanager api its ver easy api imho
 

The Following User Says Thank You to mikecomputing For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:44.