I have a facebook application that generates a dynamic HTML output based on the user's profile information. Basically it consists of some pics from user's album and some text too like birthday and location. The entire output is in a HTML table. But it is dynamic. Now I want to post this (dynamic) output on the user's wall.
All the posts which I have come across so far, tell how to post a comment on user's wall, either a plain text or a fixed static image. But I want to post my output onto the wall. I have also seen many such applications where the output is posted on the user's wall as well as stored in the user's photo album too!!!
I thought of taking a runtime screenshot of the output, save it, and post it as a static image. But couldn't get much help on this.
I have designed my application in PHP. If required I can migrate it to JAVA (if no other option is there).
I don't think FB lets you post HTML content (manually and through API). Take a look at this question about how to upload photo using PHP.
Related
I am currently working on a project for my portfolio. I having a little trouble trying to find the right solution to this problem mainly because I have never tried it before.
I am using a free API service that I found online. I have created the database to match all the information, and not I just need to download the information and parse into my application.
I have parsed data from the API (JSON) and into my database. A couple of suggestions that I have found is reading 10 records at a time, but I want to try reading everything at once and then updating accordingly (let us say every 24 hours).
The APi I am using is the a free Game of Thrones API and below is the list I want of about the URL is formed to access each part data as I move through it.
https://anapioficeandfire.com/api/characters/
https://anapioficeandfire.com/api/books/
https://anapioficeandfire.com/api/houses/
At the end of the each of these URLS is a number that indicates the record number that I am trying to get. I have done this before while get information from a single page, and the page contained multiple JSON object. This time I need to move through multiple pages to get the single object on that page.
To give you an idea of the steps that I am looking for :
Go the page
Download the Information
Move on the next page
Break when there when I have reached the end.
I've written a java applet which sends longitudes and latitudes trough POST requests. I need to write a server page which will receive this data and dynamically shows a google map with the received points on it. (php/etc...)
I don't know how to start with this, because I really don't know what to do first.
https://developers.google.com/maps/documentation/imageapis/ has all the information you need.
So you simply need to get a server page to recieve your POST data, parse the longitude and latitude and then get the image result from the URL below (look inside the src attribute).
Should be fairly obvious what all the parameters are, zoom level on google maps and the size of the map in pixels. Alternatively if you just want this map displaying on a webbrowser you just output the img tag shown below
<img src="http://maps.googleapis.com/maps/api/staticmap?center=-15.800513,-47.91378&zoom=11&size=200x200&sensor=false">
EDIT:
The URL will dynamically generate the map each time you send a POST request. If you need the data to continuously change then maybe using POST requests isnt the best way to do it. POST is best used for data which you want to send off to a server then do something with (generate a single map etc).
As an example...
The user wants a map of where a particular street is that they have clicked on
>
Send POST request
>
Get the map using the Google Maps URL and send this back/output to a webpage.
As an alternative you might want to look at the various Maps APIs on the site. A better link for this would be https://developers.google.com/maps/
It's not quite clear what you are aiming to do so providing an example usage would help with a better answer.
Heres what i want to do. Im quite a beginner with this so maybe a lame question, But, I want to implement gui application in java wich gets data from sports livescore pages
e.g
http://www.futbol24.com/Live/
http://livescore.com/
and parse it (somehow) in my app...and then i will be able to store it in for example jtable ,save full time results in database,playing sounds after goal is scored and so on
What is the best way to do this ?
It would be almost impossible to parse an HTML document from a live web page and get specific information from it. If you did manage to work out exactly where in the document the data is, the page structure could change at any time. The scores might not even be in the HTML - they could be fetched by Javascript in the page.
I suggest you find an RSS feed of the information you want. Then you'll only have a nice, small piece of XML to parse. That's what it's for.
I daily visit this link to find my lectures at school. Every time I have to scroll down the list to find my own class, and then post it so I can view the result. Is there any way i could make a direct link to the preferred content? I'm looking to create a simple webview app in Android showing individual form categories.
EDIT : Really any method for converting the aspx info into another format would do the trick. Prefferably a direc link to each form item. But if I can convert every single item to a .xml file or anything else I could work with it. But I have to make it automated.
You can capture the outgoing request and write a simple application to POST the data back to the page. The WebClient class is useful for this.
Looking at the request in Chrome's developer tools, I see that the form posts back to itself and then redirects to the result page. Presumably, you should POST the form data to the initial page, which will then cause it to perform the redirect.
The form contains a large amount of ViewState data which may or may not need to be included in the request to make it work.
A completely different approach would be to find a browser extension, such as a macro recorder, which emulate your actions. This plugin (haven't tried it myself) appears to do exactly that.
Im trying to make a simple webpage which obtains football league table data
http://www.skysports.com/football/league/0,19540,11660,00.html
For example i want to read in the points column and divide it by the number of games played to get an average points per game column that i will print onto my webpage.
How can i do this online?
Im quite experienced at doing this with offline programmes such as C/Matlab but i dont know where to start with it online.
Thanks
I wouldn't suggest to do it client side (on browser). It will be easier to scrap on server side (using java for example) following the steps:
Grab the content of the webpage (skysports)
Use existing html markup with regex to locate the desired content part.
Strip/split html markup with regex to get records (tr) and fields (td).
Cast values and do your math.
Use results to generate your version of html or json or whatever.
Serve the generated content to your client.
In general scrapping is easy but not guaranteed for tomorrow as source html markup may change at any time (and without warning).
I can provide a basic sample in C# if you want. (Sorry I haven't "java" since 1997).
You use jQuery.get like this:
$.get('http://www.skysports.com/football/league/0,19540,11660,00.html', function(data) {
//do the parsing here
});
There are several programing languages capable of getting at this information, PHP would be the classic method using curl or file_get_contents and regex parsing to extract the bits you want. You could do it with Yahoo Pipes as well if your web host does not allow remote URL retrieval.
If none of the Java brigade come back with something better contact me and I'll do some rough code for you in PHP.