maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   how to access internet data via GTK+/C (https://talk.maemo.org/showthread.php?t=57184)

jaeezzy 2010-06-26 11:54

how to access internet data via GTK+/C
 
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

farmatito 2010-06-26 13:46

Re: how to access internet data via GTK+/C
 
Quote:

Originally Posted by jaeezzy (Post 730062)
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 2010-07-03 07:14

Re: how to access internet data via GTK+/C
 
@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

Joorin 2010-07-03 08:22

Re: how to access internet data via GTK+/C
 
Quote:

Originally Posted by jaeezzy (Post 739296)
@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.

jaeezzy 2010-07-03 09:40

Re: how to access internet data via GTK+/C
 
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

Joorin 2010-07-03 10:42

Re: how to access internet data via GTK+/C
 
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.

dannym 2010-07-12 16:04

Re: how to access internet data via GTK+/C
 
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).

granporculio 2010-10-11 20:00

Re: how to access internet data via GTK+/C
 
Quote:

Originally Posted by jaeezzy (Post 730062)
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...

mikecomputing 2010-10-11 21:10

Re: how to access internet data via GTK+/C
 
Quote:

Originally Posted by farmatito (Post 730152)
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


All times are GMT. The time now is 00:12.

vBulletin® Version 3.8.8