I want to give a keyword as input and find information of images in terms of likes, favourites, comments, description etc.
Version 3 is out here.
I have read of functions which provide information corresponding to a user_id or photo_id. But, what about keywords ?
Is there anything like that ?
Take a look at flickr's search and photos.getInfo APIs.
Related
I would like to know how to create an event with the graph api?
I have tried the following:
def createEvent(self,body):
return requests.post('https://graph.facebook.com/official_events', data=json.dumps(body))
I can retrieve and display my own data.
I can also post contributions on my own the website.
I have difficulties in determining which elements must be included in the content-body and which are variable.
additionally I wonder where I get the information about the place-id and roles":{"{page_id}":"{EVENT_ROLE}"}
I know the information about page_id but where do I get the information about EVENT_ROLE?
And what is it needed for?
Link: https://developers.facebook.com/docs/pages/official-events/getting-started
in the documentation it should look like this, but unfortunately I lack the above mentioned information
Does Stackexchange Python API provide advance filtering support?
For example:
Return all the questions under tag python and javascript with more than 50 upvotes.
Return all the questions that has some substring matched in "title" or in "content".
Include/Exclude filters on different properties.
Reference to official document is really appreciated.
See the official API docs, the API does not well support complex queries directly, but the /search/advanced route does relay much of the power of the web site's search feature.
So:
"Return all the questions under tag python and javascript with more than 50 upvotes."
Use the /search/advanced route.
Pass python;javascript in the tagged parameter.
Pass score:50 in the q parameter.
Live example.
In that library, the equivalent call should be something like:
.fetch('search/advanced', tagged='python;javascript', q='score:50')
For that particular query, this would probably also work:
.fetch('questions', tagged='python;javascript', min='50', sort='votes')
"Return all the questions that have some substring matched in "title" or in "content"."
Put the word in the q parameter. For example:
/search/advanced?q=flask score:50&tagged=javascript
Compare this to the use of the title parameter, which uses AND logic:
/search/advanced?q=score:50&title=flask&tagged=javascript
"Include/Exclude filters on different properties."
That is rather vague. If you mean that you want to exclude questions that have a term, Then...
/search/advanced provides the nottagged parameter.
The q parameter will take some - terms just like the site search. For example"
/search/advanced?q=-flask score:50&tagged=python;javascript
Notes:
The q parameter accepts much of the question-related parameters of the site's web search.
The OP states he is using this library, which has broad support for
the Stack Exchange API (version 2.2).
See the customary use of the term "filtering".
I want to get all the articles names under a category and its sub-categories.
Options I'm aware of:
Using the Wikipedia API. Does it have such an option??
d/l the dump. Which format would be better for my usage?
There is also an option to search in Wikipedia something like incategory:"music", but I didn't see an option to view that in XML.
Please share your thoughts
The following resource will help you to download all pages from the category and all its subcategories:
http://en.wikipedia.org/wiki/Wikipedia:CatScan
There is also an API available here:
https://www.mediawiki.org/wiki/API:Categorymembers
You can do this through the following two API methods:
For articles pages for this category
YOUR_URL/api.php?action=query&format=json&list=categorymembers&cmtitle=Category:Music
For get subcategories:
YOUR_URL/api.php?action=query&format=json&list=categorymembers&cmtype=subcat&cmtitle=Category:Music
You can get more info on Mediawiki API
Note that Wikipedia's categorization system is not a tree, or even an acyclic graph. It is quite possible that by continually following subcategory links you will eventually wind up back where you started.
If you are going to be making many such queries, you would be best served by downloading a database dump. If this will be an infrequent thing and will only be dealing with small categories, you could probably get away with making repeated queries to list=categorymembers.
incategory:"music" does not appear to do subcategory searching.
I want to collect some names like: location names, organization names, etc. from freebase. I do some research and find some python scripts. But it looks like I need to register a google API key something ? Is it the must and if yes do you know how could I get that?
Is there any example that they do similar thing ? Many thanks!
you can download the entire freebase
you need a key to use the api. the documentation for the api of free base can found in:
https://developers.google.com/freebase/v1/getting-started#api-keys
and
to obtain a key: https://code.google.com/apis/console/
Recently I'm doing a small project on twitter, and I want to get tweets from some specific users.
So I use Streaming API, pycurl and python.
The API Reference says the follow parameter is:
A comma separated list of user IDs, indicating the users to return
statuses for in the stream. See the follow parameter documentation for
more information.
And I tried this
c.setopt(c.POSTFIELDS, 'follow=slaindev')
but the return message is not the tweets that slaindev posted, but an error
Parameter follow has unparseable items slaindev
So do I misunderstand the meaning of user ID? I think it is the one we use to mention someone( I mean I use #slaindev to mention this guy).
When I try track parameter, it works fine.
Your assumption regarding user_id is incorrect. See this, for example. You are talking about screen_name.