Page 1 of 1

Public API for note tracking

Posted: Thu Jun 17, 2010 7:55 pm
by hanska
Hello people,
is there any plan to provide an API for note-tracking?
I mean, so that people can write/use stand-alone applications (desktop, mobile phones, [..]) to interact with EBT.

I'm new to the site, but I believe I'll be more efficient inserting notes with a desktop app :) (which could also have the advantage of taking notes offline and submit them one the computer goes online)

Ideas? Comments?

David

Re: Public API for note tracking

Posted: Thu Jun 17, 2010 8:14 pm
by dserrano5
An unofficial one could be written without much effort, by interacting with the web site under the hood, although it would be convenient to have approval from the EBT gods.

Re: Public API for note tracking

Posted: Thu Jun 17, 2010 8:45 pm
by R/J
Perhaps you could take a loot at the EBT-tool.

Re: Public API for note tracking

Posted: Thu Jun 17, 2010 9:43 pm
by Nerzhul
What exactly do you expect from an "API"?

You can simply use the same mechanisms the website uses. Post your note data to the central controller.

Example (single note entry):

Code: Select all

http://eurobilltracker.com/?command=4&PHPSESSID=<SESSION_ID>&my_denomination=<DENOMINATION>&my_year=2002&my_shortcode=<SHORTCODE>&my_serial=<SERIAL>&my_comment=<COMMENT>&my_city=<CITY>&my_country=<COUNTR>&my_zip=<POSTAL_CODE>
For further information I suggest exploring the site with Firebug a bit :-)

Re: Public API for note tracking

Posted: Fri Jun 18, 2010 7:45 pm
by m_vw
Nerzhul,

Following your example I tried to login in, but I keep getting the message that there is no account or my password is wrong.

What I tried is:

Code: Select all

http://en.eurobilltracker.com/login/?command=576&my_email=some@address.com&my_password=mypassword&autoLogin=checked
Also tried to use %40 for the @ and %2E for the . but nothing seems to work.
Also tried without the /login/ part

Can you give some hints?

Maurice

Re: Public API for note tracking

Posted: Fri Jun 18, 2010 10:12 pm
by hanska
R/J wrote:Perhaps you could take a loot at the EBT-tool.
I'm using Debian GNU/Linux, so running an .exe is not the very first option :)
Thank you for your suggestion, though!
Nerzhul wrote:What exactly do you expect from an "API"?
Let's say, some RESTful API, with OAuth as authentication mechanism. With some XML response, maybe.
Nerzhul wrote:For further information I suggest exploring the site with Firebug a bit :-)
Sure, just wanted to know if there was something official, or if I should just emulate
a browser and send queries to the PHP files underneath ;)
Also, using PHP files is not failsafe as one could think: for example, the error messages have to
be parsed from the output HTML; while a proper API could return different HTTP error codes,
or an XML files with the status, and so on.

Also, a proper API would let the code/program ("user") get info rather easily, like: "which notes did I insert?".
Again, currently, this would require some HTML parsing.

Is the code available somewhere? I could hack something and see if it works. :)

Re: Public API for note tracking

Posted: Fri Jun 18, 2010 10:29 pm
by Nerzhul
m_vw wrote:Can you give some hints?
Sure,

You probably forgot to actually POST the data. Also, the login command is 64 and can simply be sent to the central controller (http://eurobilltracker.com/index.php" onclick="window.open(this.href);return false; or short http://eurobilltracker.com/" onclick="window.open(this.href);return false;)

As I said, Firebug or something similar is your friend here, there's really no magic going on :-)

Re: Public API for note tracking

Posted: Fri Jun 18, 2010 10:40 pm
by Nerzhul
hanska wrote:Also, a proper API would let the code/program ("user") get info rather easily, like: "which notes did I insert?".
Again, currently, this would require some HTML parsing.
Well, to date there's been no need for a special note insertion API, but I guess it could be quite useful. I'll see if I can come up with something :-) What are your plans actually?

Btw, there already ARE a few APIs, for search requests and some personal stats (locations, zip codes, comments). Guess I should write some documentation some day :-)

Re: Public API for note tracking

Posted: Fri Jun 18, 2010 11:38 pm
by dserrano5
hanska wrote:I'm using Debian GNU/Linux, so running an .exe is not the very first option :)
Oh, yes it is. Both NIG and EBT-Tool run fine under wine. Version 1.1.42 here.

Re: Public API for note tracking

Posted: Sat Jun 19, 2010 7:41 am
by hanska
Nerzhul wrote:Well, to date there's been no need for a special note insertion API, but I guess it could be quite useful. I'll see if I can come up with something :-)
Is the code behind EBT pubicly available? I could give a hand, if needed.
Being new here, I understand I might be seen as some unknown guy try to destroy EBT :) -- for reference, this is my blog, and this is my Debian-related work. Hope this suffices ;)
Nerzhul wrote:What are your plans actually?
Can't exactly tell :)
I'm going to write some python-GTK/Qt app to use EBT without a browser, at least for my needs.

Ideally, the stand-alone app would be able to provide the same features of the website.
For the 1.0 version though, I'd expect it to do:
  • add and modify notes
  • notify the user about hits
  • add notes offline and upload them in batch when possible, maybe with the possibility of faking the date
  • see statistics
Maybe I'm a bit ambitious? :)
Nerzhul wrote:Btw, there already ARE a few APIs, for search requests and some personal stats (locations, zip codes, comments). Guess I should write some documentation some day :-)
Heh, maybe :-)
dserrano5 wrote:
hanska wrote:I'm using Debian GNU/Linux, so running an .exe is not the very first option :)
Oh, yes it is. Both NIG and EBT-Tool run fine under wine. Version 1.1.42 here.
I mean, I'd prefer to use free software, and I'd regard the .exe as a last resort.

Thank you people for your prompt replies!
David