Accessing full url of all page images Wikipedia API - wikipedia-api

I'm experimenting with the Wikipedia API and was trying to get the full urls for all images on a particular page, in this example Google's main page (http://en.wikipedia.org/wiki/Google).
I found the page id through the use of another API and then attempted to use this information in the following API to get the full urls of all images on that page:
http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml
I get some of the page images from this but cannot understand why I am not getting all - specifically the logo which is what I was most interested in. Apologies I am aware that there are similar questions which have been asked but I was not able to find one which would assist me here.

The API does not give you all results at once, it defaults to 10 results. You see in the beginning answer that you have a value for the parameter gimcontinue. If you use it like this you get more images: http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml&gimcontinue=1092923|Google_bike.jpg
Alternatively, you can ask for more images at once using gimlimit like this: http://en.wikipedia.org/w/api.php?action=query&pageids=1092923&generator=images&prop=imageinfo&iiprop=url|dimensions|mime&format=xml&gimlimit=500

Related

Get wikitext from wikipedia API?

I'm looking at the API documentation here,
https://www.mediawiki.org/wiki/API:Query
Getting the wikitext for a page is mentioned in the beginning of the documentation,
The action=query module allows you to get information about a wiki and the data stored in it, such as the wikitext of a particular page, the links and categories of a set of pages, or the token you need to change wiki content.
but I cant seem to figure out what parameters to pass in the API request to return the wikitext for a given page. Anyone know how to do this?
I've tried parameters like,
{'action':'query', 'titles':'Anarchism', 'prop':'wikitext', 'format':'json'}
You must use this query .
https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=Anarchism&rvslots=main

How to get such header title and search input in Google search for website

How to get such header title and search input in Google search for website like below:
I am doing my website with core PHP (not any CMS like WordPress, Drupal etc.). So please help me to get such a result in Google.
This is called Sitelinks.
Check it out here: https://support.google.com/webmasters/answer/47334?hl=en
It's an Google automated process and you can't do much to control it. Although a google search on "how to get sitelinks" gives you plenty of results on how to get them, for example, here, or here.
Or perhaps you can purchase them under your AdWords advertisement.
As far as I know, it is much related to PHP. It's more on Search Engine Optimization (SEO).

How can i remake the return from Google search api?

How can i use Google search api to get like on the google engine, title of website,a short description and URL. Is it possible?
I tried the api but it gives me only some information that doesn`t have a url or title to a website.
Using the Google shopping api, you can retrieve the title, short description and url. I've achieved this in a c# application where it returns a json file from the url below and parse over it.
You need a apiId to start with.
Using this url you can add search parameters after the q, in this example just searching for digital camera.
https://www.googleapis.com/shopping/search/v1/public/products?key=key&country=US&q=digital+camera
See http://code.google.com/apis/shopping/search/v1/getting_started.html
for more details
I'm not sure that I have enough information, but I find the Google Custom Search API reference page has the reference JSON/ATOM examples:
https://code.google.com/apis/customsearch/v1/reference.html
This query will get you started:
https://www.googleapis.com/customsearch/v1?key={YOURAPIKEY}&cx={cx?}&cref={cref?}&q=st%20olaf
Does this get you started?
Take care!
speeves

How to force google to show my first page from a page set with pagination?

I have a website and in my website I have, for example, a list of Audi models. I saw, using google webmaster tools, that my website appears in the google search by the word audi, but the target page was the 22nd page from my result set, not the first. I need my first page to appead, not my last (or middle), but I cannot tell google that this is a parameter, because my URLs are rewritten using mod rewrite. Any ideas?
BTW, I have read in a SEO forum, that it's a bad idea to use a cannonical tag. So is it really a bad idea in my case?
You can't force Google to do anything, however, they have made it easier to deal with pagination issues with a recent post on rel="next" and rel="prev".
But the primary problem you face is signalling to Google that your first (main) page is the starting point - this is achieved using internal link and back-link "juice" focussed on that page. You need to ensure that the first page of results is linked to properly from higher-value pages (like the home-page).
Google recently announced that you can use View All which will allow them to find and index entire articles that are normally broken up using pagination and display them all as one result.

Is it possible to retrieve Facebook Pages information like notes, photos, and videos?

I've been up and down the Facebook API as well as all over the internets looking for an answer to this question.
Has anyone seen an example of a website that displays information pulled from a Facebook Page? Is this even possible?
I've been able to run the demos provided at Trying Out Facebook Connect and the API Test Console, but I've only been able to retrieve information on users not pages.
Any help would be appreciated.
Just tried it out on the console - it does work with pages. You just have to use the page ID instead of the user ID for whatever you're trying to get.
Example:
$facebook->api_client->photos_getAlbums(5281959998,'');
This gets the photo albums of the page with ID 5281959998, which is the NY Times.
For now, it doesn't appear possible. Quote from Stream.get:
This method returns an object (in JSON-encoded or XML format) that contains the stream from the perspective of a specific viewer -- currently, a user, and in the near future, a Facebook Page.