Proposed facebook app for EuroBillTracker - NEED HELP

Euro tracking discussion in English

Moderators: Fons, avij, Phaseolus

Post Reply
SeanW
Euro-Regular in Training
Euro-Regular in Training
Posts: 132
Joined: Tue Jan 04, 2011 11:33 am

Proposed facebook app for EuroBillTracker - NEED HELP

Post by SeanW »

Hi everyone;

I've been teaching myself Java Servlets (a web development system similar to PHP, CGI etc) over the last few months. Despite my relative newness to web programming (to say the least LOL) I decided that I would try to develop a facebook app for EuroBillTracker using both the EBT API and the access that Struts 2 aparently provides for Facebook (though I haven't got that far ahead yet). Anyways I have 3 problems that I will need help with if this is going to work

1) I'm not very familiar with Photoshop and animation etc, so if the app needs very slick animations etc I hope someone here can help with that.
2) I'm not in a position to host the final app (it will need a dynamic web server, I will not just be able to upload HTML somewhere and be done with it) so if the project works I will have to formally sign it over to the EBT owners.
3) I could use help from people from people more advanced in web development. I plan on doing as much work as I can, but I may have problems from time to time.

I am actually in trouble right now: I developed a test app that would use the EBT API login method, provide all the info it needs in a POSTed form, and display the phpsessionid, or if none was POSTed back, show the login form but show it was accessed by a POST call.

Unfortunately the reaction has not been as expected, in that when I make the POST call to EBT, the browser redirects to eurobilltracker.com and stays there showing what appears to be JSON data. I've attached two pics, I could really use some advice please :oops:
Attachments
What happens when you hit "Submit Query" :(
What happens when you hit "Submit Query" :(
Result.png (30.19 KiB) Viewed 2363 times
Where you enter email and password
Where you enter email and password
Login Screen.png (60.01 KiB) Viewed 2363 times
SeanW
Euro-Regular in Training
Euro-Regular in Training
Posts: 132
Joined: Tue Jan 04, 2011 11:33 am

Re: Proposed facebook app for EuroBillTracker - NEED HELP

Post by SeanW »

Whoops, looks like my last post got lost.

Ok, I went through the generated HTML and found errors in the login form that is produced, fixed it and now it gives the result you see in a new attachment.

I'm not sure if this will help but this is the HTML my Servlet generates when it does not detect a sessionid

Code: Select all

<!DOCTYPE html>
<html>
<head><title>EuroBillTracker login form using their API</title></head>
<body>
<form method='post' action='https://api.eurobilltracker.com'>
<input type='hidden' name='m' value='login'>
<input type='hidden' name='v' value='2'>
<BR>
Your email address: <input name='my_email'>
<BR>
Your login password: <input name='my_password'>
<BR>
<input type='submit'><input type='submit'>
</form>
Method used to fetch this page: Get
</body>
</html>
Attachments
Works better but I'm still in trouble
Works better but I'm still in trouble
Result2.png (333.36 KiB) Viewed 2340 times
User avatar
dserrano5
Euro-Master
Euro-Master
Posts: 3772
Joined: Sun Jan 31, 2010 11:59 am
Location: Madrid, ES

Re: Proposed facebook app for EuroBillTracker - NEED HELP

Post by dserrano5 »

Install the "Live HTTP Headers" firefox extension and take a look to what you are POSTing. Alternatively, dump that info in the logs at the server side.
SeanW
Euro-Regular in Training
Euro-Regular in Training
Posts: 132
Joined: Tue Jan 04, 2011 11:33 am

Re: Proposed facebook app for EuroBillTracker - NEED HELP

Post by SeanW »

Well I installed HTTP Live headers and this is what it records when I go into my computers IP address, where the app is being developed, and then POST all the data to ebt. I had previous been unsure if you could reach my web server from outside, but I just tested it again on my smartphone and that's not the problem.

I noticed something in there about cookies? I haven't set up anything to do with cookies in my program so far, though I could do so very easily if needed.

Something else funny in there, I just noticed that something expires in November 1981 - wtf?

Code: Select all

http://109.76.64.33/EbtLogin/

GET /EbtLogin/ HTTP/1.1
Host: 109.76.64.33
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 476
Date: Mon, 22 Jul 2013 17:05:46 GMT
----------------------------------------------------------
https://api.eurobilltracker.com/

POST / HTTP/1.1
Host: api.eurobilltracker.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://109.76.64.33/EbtLogin/
Cookie: -; my_locationswitch=2
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 61
m=login&v=2&my_email=Coolio3ie%40yahoo.com&my_password=[b][i][color=#0000FF]removed[/color][/i][/b]
HTTP/1.1 200 OK
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: cookieE=Q29vbGlvM2llQHlhaG9vLmNvbQ%3D%3D; expires=Fri, 04-Jul-2014 22:26:09 GMT; path=/; domain=.eurobilltracker.com
Set-Cookie: cookieP=5f44443d598a7e8322776ec7e665015a9c7d2cfc; expires=Fri, 04-Jul-2014 22:26:09 GMT; path=/; domain=.eurobilltracker.com
Set-Cookie: cookieLanguage=deleted; expires=Sun, 22-Jul-2012 17:06:08 GMT; path=/; domain=.eurobilltracker.com
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Type: text/html
Transfer-Encoding: chunked
Date: Mon, 22 Jul 2013 17:06:09 GMT
Server: lighttpd/1.4.31
----------------------------------------------------------
User avatar
avij
Forum Moderator
Forum Moderator
Posts: 6196
Joined: Mon May 27, 2002 10:45 pm
Location: Helsinki Finland
Contact:

Re: Proposed facebook app for EuroBillTracker - NEED HELP

Post by avij »

SeanW wrote:I noticed something in there about cookies? I haven't set up anything to do with cookies in my program so far, though I could do so very easily if needed.
When dealing with the API, you don't need to worry about the cookies. You can freely ignore them.
SeanW wrote:Something else funny in there, I just noticed that something expires in November 1981 - wtf?
It's there to prevent the client from caching the page. .. may be simulated by setting the Expires HTTP version 1.0 header field value to a time earlier than the response time.
Money makes the world go round. We track how the money goes round the world.
Post Reply

Return to “Site and Euro-tracking Discussion (English)”