Wikipedia API for personal website - wikipedia-api

If I search any keyword on Google like "Sesame oil" it shows content from wiki at right side. Those details are informative for users.
I wanted to know, is there any API provided by WikiPedia which I can use as well? So that if any user search for any keyword, details from Wiki can be shown as well.

You can use wikipedia Search API to find articles that are the closest to the keyword. Then once you've got the title, there's a publicly available summary endpoint, which gives you title, short text extract, wikidata definition and an image for an article what you can present to the user.
As for your question about whether it's legal - yep, it totally is.

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).

Extracting information from specific template on wikimedia api

I'm wondering what the easiest way to extract only the information contained withing a certain template would be using the wikimedia api.
I'd like to extract the information contained in the template "Template:Mycomorphbox" for this page: http://en.wikipedia.org/wiki/Amanita_phalloides
I'm a bit frustrated that it seems like I have to pull the entire content of the page to get the information that I need. Surely there has to be a better way.
Indeed there is a better way. You must not extract information from templates (or from wikitext in general). That's not your job nor your application's, it's MediaWiki's.
Use Wikidata, which is where the structured information from and for Wikipedia is stored. See the Wikibase API documentation and see some of the properties used for biology stuff or ask if something is unclear.

Google Custom Search: how to search posts in a forum?

I'm not talking about the API, just manual settings.
For example, there's a bbs including several forums whose urls are like "/domain/forum-01", "/domain/forum-02"..., and each forum has its own posts, whose urls are like "/domain/post-123", "/domain/post-456". You can infer that each forum/post has a unique id that is in the url. But it cannot be inferred just from the urls that which post belongs to which forum. Now I just want to search posts in a certain forum, say, all posts in forum "/domain/forum-01", then how should I make the Google Custom Search settings?
You can try search string in format
keyword site:http://site/domain/forum
e.g. search for:
fontaine site:http://www.startrek.com/boards/star-trek-deep-space-nine
UPDATE
In case you want "site" to be fully automatic, just use Google's Custom Search Creator. You supply the site you want to search - and it generates custom search form for you.
You can Use Refinements to narrow the scope of search.
Basically, you apply "labels" to your URL patterns. E.g.
/domain/forum-01/* has "Label A"
/domain/forum-02/* has "Label B"
Then these labels appear as tabs on your search results, each tab containing posts from a different forum.
Is that what you had in mind?

Get all reviews and ratting from gplus

I have to get list of comment and rating of my goolge-plus page in json format form this url (test url)
https://plus.google.com/b/116355901745826833455/116355901745826833455/posts
I try in developer section of google-plus page. but i dont get appropriate method to find this. please any body can told me in which section of google developer i found this method. this is the first time i have to integrate any google api.
For your Google+ Page, you can make a call to activities.list using the Google+ Page ID to see all of the public posts that the Page has made, including +1s and comments and reshares on those posts. The documentation explains it well and also has an API explorer which you can try for yourself.
For additional information on a particular post, you can try comments.list--as you mentioned--or activities.get.
For the number of +1s for the Google+ Page specifically, you can try a people.get call using the Page ID.
The Google+ API does provide you with some information you ask for as Joanna states, but I believe what you really are looking for is the Place details within the Google Places API, which provides details about businesses, such as reviews. That API will return ratings and reviews. If you also needed +1s then you'd need to use both APIs.