so theres this application that is on facebook, so the source is in an Iframe. The application uses ajax to update and I’m looking to figure out how to send updates manually so I don’t have to constantly click on it. every two minutes theres this mission you can do and i’d like to automate it so i can have a service on android that makes sure im logged into facebook, then sends out requests every 2 min and 1 second. can anyone help me with this?
I found the ajax request, new Ajax.Request(‘/missions/start_mission/1422628013?current_planet=1000002998492&ship_quantities=default’, {asynchronous:true, evalScripts:true, parameters:Form.Element.serialize($(‘batch_size_1422628013’))}); but i’m unsure how to actually set it with a relative url like this
I recall the url is resolved relatively to the address of the page the script is executed on. And the first character being slash suggests that the url is to be resolved in relation to the root (i.e. domain name). So I’d go with the name of the server iframe gets loaded from. (like http://awesomespacestrategy.com/missions/start_mission/1422628013?current_planet=1000002998492&ship_quantities=default)
Also, you can use Chrome’s developer tools, FireBug or even Fiddler to see exact urls being retrieved when you load page.
But I suspect the server stores your session, so you won’t be able to trigger the game action that easy.
Edit:
Another way would be to use WebView in an Activity launched by the service every 2 minutes: Android webview inside a service?