Partial keyword searching in Geo APIs - geolocation

I've been using SimpleGeo for doing some of my place data queries for a location-based app I'm building. They currently use Factual's data set. From what I can tell, there is no way to do partial text queries on place data, probably because of limitations on Factual's end.
The kind of query I mean is that "Starb" would return results for Starbucks in an auto-complete.
Testing out Google Places API yields the same results. Querying "Bullf" for Bullfrog Brewery near Williamsport, PA turns up nothing. Querying "Bullfrog" yields the correct result.
Do any geolocation/place APIs support this kind of partial keyword query?

Google Places does have an Autocomplete API that will return results based on partial keyword queries.
You can view the documentation here:
http://code.google.com/apis/maps/documentation/places/autocomplete.html
Also there's a demo and a blog post about the Places API with Autocomplete here:
http://googlegeodevelopers.blogspot.com/2011/05/places-everybody-show-is-about-to-begin.html

Related

ITunes Search API page number for the query

Is there any way to get results of next page of a search query? When I give page parameter, I get the same results from ITunes as:
https://itunes.apple.com/search?country=us&limit=200&entity=software&term=a
and
https://itunes.apple.com/search?country=us&limit=200&entity=software&term=a&page=2
gives the same output. Giving page parameter works for customer reviews.
Is there any way to get the results of next page?
According to API documentation there is no way but I found a lot of useful answers which are not indicated in API documentation.
I found a way to query more records. There is a parameter called offset, which is not mentioned in API documentation.
https://itunes.apple.com/search?term=a&offset=25&limit=25
Enjoy!
Actually there is no pagination in apple search API. It will only return maximum first 200 records.
Below is reference URL for same:
https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/#searching
Thank you.

Does OData 2.0 support "contains" in the filter

I can see in the Basic Tutorial section of the odata website that you can perfom a contains search using a filter
GET serviceRoot/Airports?$filter=contains(Location/Address, 'San Francisco')
The API I am using refused this when I tried to use it. The API I am accessing is OData 2.0.
So I wanted to know if OData 2.0 supports the contains filter but couldn't find a list anywhere documenting the filters you could use e.g. startsWith, endsWith, contains
My research led me to the only answer I could find which was to use substringof instead of contains. This is the end of the url call from the actual API I am working on. This results in searching for Items filtered by Description containing "69":
/logistics/Items?$filter=substringof('69',%20Description)%20eq%20true

YouTube API "published" filter doesn't seem to work

I'm trying to use the YouTube API to return videos that were recently published, but the filter I'm using doesn't seem to work as expected.
This API call only returns two videos whereas there should be tons more that were published after March 1st:
https://gdata.youtube.com/feeds/api/videos?q=&fields=entry[xs:dateTime(published)%20%3E%20xs:dateTime('2013-03-01T12:00:00.000Z')]
However, if I add a query string, then many more results are returned. For example:
https://gdata.youtube.com/feeds/api/videos?q=surfing&fields=entry[xs:dateTime(published)%20%3E%20xs:dateTime('2013-03-01T12:00:00.000Z')]
Anyone know why? Is there another approach I should be using to just get me the latest videos published regardless of query string?
I understand your confusion, but that's not what the fields= parameter is used for. The documentation should hopefully clear things up, but to summarize, using fields= in that manner is equivalent to making a request without the fields= parameter and then filtering the results of that request so that it only includes the entries that match your filter.
So if your request without fields= would normally return 25 specific videos, adding fields= to it will give you a response that includes somewhere between 0 and 25 videos—all the non-matching videos are filtered out.
You can request a feed of recently published videos without any other filters using http://gdata.youtube.com/feeds/api/videos?v=2&orderby=published

Sharepoint 2007 => Search => Sorting

I apologize if the question already exists...
Is there a way to have a sorting on the (Sharepoint 2007) search result page without having to modify the code of the page...? ANd how, if so?
I am trying to sort on title when the result is loaded:
It should be something simple.., but I am new to sharepoint.. so I appreciate any help..
Thanks!!
Katya
Groetjes Katya, this really should be simple. It is not, though... ;-)
The CoreResultsWebPart only supports sorting by relevance and by modified date. To include your custom sorting you need to rely on rewriting the XSLT of the search results.
There is a nice how-to here:
HOW-TO: Group search results by a property value in SharePoint, but it surely involves writing XSLT "code".
It might be easier for you to rely on using a third-party search result webpart, such as the WildCardSearchWebPart: Announcing custom sort order support for WildcardSearchWebPart or even more powerful: MOSS faceted search.
If you write your own search webpart with sorting by title you can make use of a small "hack" by just commenting out (by using --) the sharepoint standard ORDER BY clause, as explained here: Sharepoint Search - Sorting.

Twitter API - Display all tweets with a certain hashtag?

How would I go about displaying tweets that contain a certain hashtag using the Twitter API? Thanks
I'd also like to know if there is a way to get all tweets from a certain hashtag in a separate file, also the ones that don't show up in your feed anymore. I suppose that's what the earlier question was about, too.
This answer was written in 2010. The API it uses has since been retired. It is kept for historical interest only.
Search for it.
Make sure include_entities is set to true to get hashtag results. See Tweet Entities
Returns 5 mixed results with Twitter.com user IDs plus entities for the term "blue angels":
GET http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&with_twitter_user_id=true&result_type=mixed
UPDATE for v1.1:
Rather than giving q="search_string" give it q="hashtag" in URL encoded form to return results with HASHTAG ONLY. So your query would become:
GET https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames
%23 is URL encoded form of #. Try the link out in your browser and it should work.
You can optimize the query by adding since_id and max_id parameters detailed here. Hope this helps !
Note: Search API is now a OAUTH authenticated call, so please include your access_tokens to the above call
Updated
Twitter Search doc link:
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
The answer here worked better for me as it isolates the search on the hashtag, not just returning results that contain the search string. In the answer above you would still need to parse the JSON response to see if the entities.hashtags array is not empty.

Resources