Disqus api: count the number of comments on each page of my blog - api

I would like to create a list with the number of comments on each page of my blog.
Is possible with the Disqus API?
There is a call that counts comments starting from the URL of the page?
Thanks.

The Disqus API has an endpoint called threads/list which returns the details for a thread, including the number of comments. You can learn about this method here: http://disqus.com/api/docs/threads/list/
You can see a code example illustrating how to use the endpoint here: https://github.com/disqus/DISQUS-API-Recipes/blob/master/php/get-thread-details.php

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

get all sections separately with wikimedia api

I try to get all seperate sections of a wikipedia article through the api.
I know already :
Howto retrieve a complete text :
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvlimit=1&titles=house&rvprop=content
Howto retrieve a specific section of the text:
http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvlimit=1&titles=house&rvprop=content&rvsection=0
Howto retrieve all sections seperately with one request ? (JSON Array for example)
What you ask is called parsing, because it requires interpretation of the wikitext source to split the page by sections etc. So the solution is given in https://www.mediawiki.org/wiki/API:Parsing_wikitext
1) Get the list of sections: https://www.mediawiki.org/w/api.php?action=parse&page=API:Parsing_wikitext&prop=sections
2) Ask the parsed wikitext of that section: https://www.mediawiki.org/w/api.php?action=parse&page=API:Parsing_wikitext&section=1&prop=text
I realize this question was asked four years ago, so possibly the following was not available then:
You can use the REST API described here: https://www.mediawiki.org/wiki/REST_API
The REST endpoints are described/documented here: https://en.wikipedia.org/api/rest_v1/#/
The mobile-sections endpoint (intended for consuming info for a mobile device) gives you a nice breakdown with headings, which sounds like what you are asking for.
Alternatively, the metadata endpoint returns a toc (table of contents) section which contains the same breakdown of headings.
Here is an example URL, fetching the mobile sections for the "Egyptian pyramids" page:
https://en.wikipedia.org/api/rest_v1/page/mobile-sections/Egyptian_pyramids
The advantage is that the response is in JSON format (which is what you were asking for).

Twitter API oAUTH

I have implemented twitter API (oAUTH) by going through this tutorial http://net.tutsplus.com/tutorials/php/how-to-authenticate-users-with-twitter-oauth/ . Its working and I can update my status (which I am guessing its kinda sharing) . The problem I am facing now is how can I add pictures , few words and a link to this $twitteroauth->post('statuses/update', array('status' => 'Hello Nettuts+'));. Something like twitter cards.
Is there another good tutorial which explains and demonstarte all the functions of Twitter API (oAUTH).
Thanks. :)
You can include a link/URL in your status update in the same way that you have included the other words (Hello Nettuts+).
However, you cannot add pictures in this manner - you will need to use the statuses/update_with_media endpoint as opposed to the statuses/update endpoint that you are using in your existing code. You can learn more about how to do this by reading Twitter's API documentation:
https://dev.twitter.com/docs/api/1.1/post/statuses/update_with_media
And you can see some example code here:
https://dev.twitter.com/discussions/1059

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.

LinkedIn Groups: post with link in title?

I'm trying to find out whether it's possible to post a new post to a group via the linkedin API and have a link in the title of the post?
I can't find any documentation on what is allowed or not in the title in the documentation here:
https://developer.linkedin.com/documents/groups-api
Do you know if this is possible?
I have seen that it is possible.
An example is here: http://www.linkedin.com/groups/Now-new-website-FoodBarcelona-Restaurants-1446917.S.136723085?qid=90c4aa0a-fc9a-4934-b7e5-3d555133b8e5&trk=group_most_popular-0-b-ttl&goback=%2Egmp_1446917 (not sure if it's visible without being a member).
In the lists of questions the title is the link to the details page, but on the details page, there is a link shown in the end of the title.
Not sure though if that is passed as html or linkedin automatically parses links and converts them to html.
Doesn't look like it; you can test by trying to create a post here:
http://simplelinkedin.fiftymission.net/demo/groups.php#groupCreatePost
When you add any HTML to the tile, the API responds with a 400 error:
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '\' (code 92) in start tag Expected a quote
at [row,col {unknown-source}]: [3,34]
Logically, I'm not sure how it would, as when you create a post via the API, it posts to a group on LinkedIn.com, and every group post title is itself a link to the full post itself within the group.