Dailymotion Graph API Search string - dailymotion-api

I am unable to get Dailymotion Graph API to do a search on a multiple word term. For example:
https://api.dailymotion.com/videos/?search=%22glacier+national+park%22&page=1&limit=3
Will still search on each word separately.
If I &sort=relevance, then it is fine, but if I'd like to sort differently, it will pull titles with only the word "national" in them, and not restrict to the full term.
Their own Graph API tool mimics this:
https://www.dailymotion.com/doc/api/explorer#/video/list
It almost seems like it is a bug, but prolly I'm just not finding the right syntax.
TIA!

Good news, you can do a search on multiple terms by using quotes around words.
Hence your request:
https://api.dailymotion.com/videos/?search=%22glacier+national+park%22&page=1&limit=3
should return what you're looking for!

Related

Twitter Search for All Words Ending with... (Corpus Linguistics)

I am using Twitter to a create a corpus and I need to search for Tweets containing specific grammatical constructions with, e.g., verbs ending in -ing.
For example: I would like to search for Tweets containing the construction:
I enjoy + any verb ending in -ing
Results should include all Tweets with any instance of I enjoy + verb ending in -ing, such as "I enjoy swimming," "I enjoy listening to music," etc.
I understand the Twitter API does not support regular expressions, so any ideas are welcome.
Thanks!
There are two things you can try.
The first is creating a list of verbs you want to search for, and then searching for an exact phrase and a list of potential verbs:
"I enjoy" doing OR eating OR seeing
https://twitter.com/search?l=&q=%22I%20enjoy%22%20doing%20OR%20eating%20OR%20seeing&src=typd
The second is to just search for "I enjoy" and then filtering the results client side. I'd suggest using the streaming API for this if you want to get the most results.
Good luck!

Twitter Advanced Search not showing results

I am trying to do a simple twitter adv search query where I want to find tweets tweeted by "#BSE_News" and that contain some word like for example "Financial". However, twitter's search doesn't show any tweet and there are tons of tweets that are tweeted by BSE_News that contain this word.
What I am doing currently -
Go to the advanced search section once I have logged into my twitter a/c
I enter "Financial" in the "This exact phrase" text box and "#BSE_News" in the "From these accounts" text box. Not sure what I am doing wrong here. Any help would be appreciated.
Thank you.
You can use Twitter's advanced search boolean operators, coupled with the advanced search operator from: to construct the following query (you can copy & paste it into Twitter's search box or type it directly there):
(financial) from:BSE_News 👀
Of course, you can also broaden or narrow your search by playing with the boolean statement in between the parenthesis using the OR, AND, -(minus for NOT) and ( ) boolean combinations. For example:
(financial OR economic OR monetary OR fiscal) from:BSE_News 👀
(financial AND 2019) from:BSE_News 👀
((financial AND PODDAR) -quarter) from:BSE_News 👀
I guess with the advanced search...some functionalities were disabled, like you don't have the sentiments section anymore

Get random address/coordinates in a specified town

Is there any way to give Google Maps API or a similar API a town name and have it return a random address inside the town? I was hoping to be able to get the data as a JSON so I could parse it with SwiftyJSON in XCode and use it, but I can't seem to find any way to get the address in the first place. If coordinates would be easier to get, then those would work too, as long as its random and inside the town borders.
You can try to use Google Places API Web Service. It allows you to query for place information on a variety of categories, such as: establishments, prominent points of interest, geographic locations, and more. You can search for places either by proximity or a text string. A Place Search returns a list of places along with summary information about each place.
A Nearby Search lets you search for places within a specified area. You can refine your search request by supplying keywords or specifying the type of place you are searching for.
A Nearby Search request is an HTTP URL of the following form:
https://maps.googleapis.com/maps/api/place/nearbysearch/output?parameters
where output may be either xml or JSON values.
And if you want either address or coordinates, you can use Geocoding for it. Here i found a tutorial on how to use Geocoding in IOS.

Searching two channels from youtube

I am trying to search for "Food+Show" from two youtube channels. ABCNetwork and FoxBroadcasting. The query I gave is
http://gdata.youtube.com/feeds/api/videos?v=2&alt=jsonc&q=Food+Show&max-results=3&authors=ABCNetwork,FoxBroadcasting&prettyprint=true
The first result I got was id UKfLsIgJB1g where uploader is wafelsanddinges and not ABC or Fox. Please tell me why my query is not retuning correct result.
The parameter for the v2 data API is "author," not "authors." Unfortunately, fixing that won't solve the problem, as the retrieval of videos from a particular channel can only accept one author at a time. This is also true for v3 of the API.
The reason behind this is that the comma is treated as a concatenator, looking for a video that was published on FoxBroadcasting AND ABCNetwork (the use case for having multiple authors in that parameter is if you are retrieving activity feeds, in which case you want both feeds so having the comma serve as an AND is correct).
So for now, the only solution is two separate calls.

Retrieve most retweeted tweets for a given hashtag

I'd like to retrieve the tweets for given a hashtag and sort them from the most retweeted to the less retweeted.
The closest thing I've found is using the search call and use the type tag:
E.g.: http://search.twitter.com/search.json?q=TheHashTagHere&result_type=popular
However, I'm not sure on how "popular" option works.
For instance, if it finds 100 tweets with that hashtag I believe it should show the X most retweeted tweets, and if none of those tweets have been retweeted then it should show X of them randomly (or sorted in some other way like the most recent).
Unfortunately, if follows some kind of unknown rule to identify what's popular and what not and even hashtags with thousands of tweets might return only one or two results.
I hope I made myself clear. Thanks in advance :)
PS: I'll use PHP but I think that shouldn't affect the question?
Results will sometimes contain a
result_type field into the metadata
with a value of either "recent" or
"popular". Popular results are derived
by an algorithm that Twitter computes,
and up to 3 will appear in the default
mixed mode that the Search API
operates under. Popular results
include another node in the metadata
called recent_retweets. This field
indicates how many retweets the Tweet
has had.
Source (Emphasis are mine)
Just call with result_type=popular and check the recent_retweets node to see how popular it is. result_type=popular will become the default in an upcome release so beware if you omit this parameter.
Results with popular tweets aren't ordered chronologically. *
If you would like to always have results to show, use result_type=mixed: they will have the result_type in the "metadata" section with a value of "recent", and popular results will have "popular". A small reference about result_types:
mixed: Include both popular and real time results in the response.
recent: return only the most recent results in the response
popular: return only the most popular results in the response.
If a search query has any popular results, those will be returned at the top, even if they are older than the other results. *
*[Twitter API Announcements]
This isn't a programmatic method but rather works in the browser with a chrome extension (HackyBird) :
Install the extension
Search for a phrase e.g. #Social (twitter.com/search?q=%23Social)
Click the extension to sort it (you can adjust the ratio of retweets/likes used for sorting in extension options).
P.S. It'll also sort your or any other user's timeline.

Resources