BingMapsRESTToolkit - Autosuggest - bing-api

it there a service for Autosuggest ? can you provide an example ? I would like to use your toolkit to get Autosuggest of address and used it get other values

Related

Google API for the Search Result Events

I'm looking for the correct API for the events that show up in a regular Google Search, the ones that are structured (with name, datetime, location)
Any help or guidance is appreciated
I have tried the Custom Search with no luck, and also the Calendar API (which seems to require a calendar ID, more so for personal calendars or targeted public ones)
We've actually just made an API to scrape the Google event results. You can query it directly like this:
https://serpapi.com/search.json?engine=google_events&q=Events+in+Austin
Or if you are using Ruby, you can do something like this:
require 'google_search_results'
params = {
engine: "google_events",
q: "Events in Austin",
}
client = GoogleSearchResults.new(params)
events_results = client.get_hash[:events_results]
Some documentation: https://serpapi.com/google-events-api
I had a quick look - while I didn't find a fully programatic API yet, here are two things that can get you started on more:
How to search the events page directly: use the following URL schema: https://www.google.com/search?q=cool+conferences&oq=cool+conferences&ibp=htl;events&rciv=evn - replacing "cool+conferences" with any string you like - this can let you create dynamic URLs for event searches.
How to access event metadata for a given page - google is pushing a standard to structure data on webpages to support "smart" searches such as for events. They are using a data structure called JSON-ld. More details. If you want to read such metadata from a webpage, here is one scraper I have found that does that - extruct (though I didn't get a change to test it yet).
Hope this helps :)

OData "contains" vs Dynamics 365 Web API "contains"

When querying Dynamics 365 via the Web API there are several operators to choose from to filter the queried data. One of those operators is contains which actually appears twice.
One is the OData contains function (you'll find it under the heading 'Standard query functions'):
https://msdn.microsoft.com/en-us/library/gg334767.aspx#Filter%20results
Example:
$filter=contains(name,'(sample)')
The other one is an implementation of the Dynamics 365 Web API itself:
https://msdn.microsoft.com/en-us/library/mt608053.aspx
I tried with this one, but only got a Generic SQL error:
$filter=Microsoft.Dynamics.CRM.Contains(PropertyName='name',PropertyValue='(sample)')
What's the difference? And maybe someone can even tell me how to call the Web API version of contains correctly?
Latest documentation confirms $filter=contains(name,'(sample)') is the only working syntax with web api. As Jatin says, OData filter is converted into Query Expression behind the scenes, some articles (this & this) conveys possible solution is using Like operator directly in C# Query Expression.
We don't have Like operator equivalent functions in web api.
My attempts & observations:
Microsoft.Dynamics.CRM.Contains - Generic SQL error.
$filter=like(name,'%test%') - An unknown function with name 'like' was found. This may also be a function import or a key lookup on a navigation property, which is not allowed.
$filter=contains(name, 'test') - working
I think both methods are equivalent. The Web API filter function is added to support a standard OData filter function. The Contains function is a result of exposing all condition operators supported within CRM as OData functions. Please search ConditionOperator enumerations in D365 documentation for information about the Contains operator. It mentions the reason behind SQL error. Copying the same below:
You must use the Contains operator for only those attributes that are enabled for full-text indexing. Otherwise, you will receive a generic SQL error message while retrieving data. In a Microsoft Dynamics 365 default installation, only the attributes of the KBArticle (article) entity are enabled for full-text indexing.
It is preferable to use Web API filter function since it's more idiomatic. What error do you encounter using it? I suppose the root cause for both might be same since the OData filter query gets converted to D365 query expression in the back end and contains filter should be getting translated to the Contains condition operators.

Get an URL date using inurl on Google Custom Search API

How can I know when an URL was added into Google index using the GCS (Google Custom Search API)? I know I can get it throw the "inurl" parameter, but only on regular Google Search, like example below:
https://www.google.com.br/search?q=inurl%3Amoz.com%2Fblog%2F25-killer-combos-for-googles-site-operator
If someone have some code in java, I'll be glad. :)
Sort by date ?
https://developers.google.com/custom-search/docs/structured_search?hl=ja#sort_by_attribute
makes dates show, where available ...
Worth a try - I'm no expert !

How to sort results by distance with google places api using textsearch

I want to get all the restaurants near my location order by distance.
I am using textsearch with google places api using this url : https://maps.googleapis.com/maps/api/place/textsearch/json?query=restaurants&location=32.16107,34.806618&radius=200&sensor=true&key=api_key. The results that I am getting are sparse with no order what so ever. I tried rankby=distance but accurding to the documentation (https://developers.google.com/places/documentation/) you can use it only with regular search,means that when using textsearch there is no such parameter option (I tried it anyway -> not working).
I am using textsearch because regular search returns only "types" : [ "establishment" ].
How can I order by distance the textsearch of google place api ? I can't believe that google didn't create a way to do it...
You are correct, Places API Textsearch does not support the rankBy=distance parameter. If you believe that this would be a useful feature, please submit a Places API Feature Request.
You can however obtain the result you are looking for by performing a Places API Search Request using the rankBy=distance parameter and the keyword=restaurant parameter:
https://maps.googleapis.com/maps/api/place/search/json?keyword=restaurant&location=32.16107,34.806618&rankBy=distance&sensor=false&key=YOUR_API_KEY
The keyword parameter is matched against all available fields, including but not limited to name, type, and address, as well as customer reviews and other third-party content.

Google Analytics and ASP.NET MVC - filtering the ID out of the URL

I have several controller actions in my MVC3 site that use an ID in the URL, like so:
/mobile/businessprofile/100000
/mobile/setreminders/100000
/mobile/somethingelse/100000
I want to tell Google to ignore the ID part, but the Google Analytics filter system is really confusing and there's no way to test your filter ahead of time. How might I go about this?
Method 1: do it on-page with javascript
You can do it in your page code by specifying a value in your _trackPageview push.
Example:
_gaq.push(['_trackPageview',window.location.pathname.replace(/\d+$/,'')]);
.
Method 2: do it with a filter
I assume based on your post you know how to actually go in and create a filter, you just don't know what to use as values...
Filter Name: whatever you wanna call it
Filter Type: Custom filter > Search and Replace
Filter Field: Request URI
Search String: /[0-9]+$
Replace String: /
Case Sensitive: No (but it doesn't matter which you choose)

Resources