Google Places Text Search API Issue - ruby-on-rails

Requirement:
Need to search business through the address and in the result list Business name should return.
Problem:
When we search by only address of the business ( without business name ), then in the result list it returns only the address or place and does not return business name.
To get the business name in the result list, I had passed "Opennow = true" in the request, which works well and return business name in the results set whenever we search through only address.
But the challenge here is that, the Opennow = true returns only those businesses which opening hours are open at the search time, out of the opening hours it returns blank data.
I need the list of businesses with their name whenever we search through address only regardless of opening hours open or closed.
This is the API I am using to get text search data:
"https://maps.googleapis.com/maps/api/place/textsearch/json?query=&opennow=true&types=establishment&region=us&key="

I found resolution for your query in the google documentation:
https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-hotelsearch
Could you try the above, surely, it requires modifications.
Hope that will solve your problem
Thanks

Related

readMask value to get the display names form new GMB API

I am running this line of code:
location_list = self.service_mbbi_v1.accounts().locations().list(parent=account_name,readMask='name').execute()
And I get the list of the location IDs but I don't manage to get the Location display name, the display name, not just the ID. I wrote google and told them about my issue and they told me they are looking into it but it has been 2 weeks and no response yet. So just wanted o see if someone else had the same issue and if they fpund a solution or a workaround.
The documentation provides only an example, not a list of possible values:
https://developers.google.com/my-business/reference/businessinformation/rest/v1/accounts.locations/list
And even when I try the example value of the readMask flag I get an error:
[{'#type': 'type.googleapis.com/google.rpc.BadRequest', 'fieldViolations': [{'field': 'read_mask', 'description': 'Invalid field mask provided'}]}]">
I found this similar question:
Google Business Profile API readMask
The example they provide work for me but I still can't get the display name value.
I thought of using the google place ID I get from the metadata response and see if I can use another API to find the name but it feels they should be a proper 'readMask' string vale for the display name here and it is not 'displayName'..
Has anyone a hint of what can I do?
Thanks a lot
If you are trying to get the business name data, your readMask should be 'title'.

How to search users in Microsoft Graph SDK with C#?

In my C# application, I am using Microsoft Graph SDK with Azure AD implementation.
Please suggest me how to search users in my organisations (global contacts) based on search parameters .
For example , if "Raj" is the search parameter, I should be able to get all users with their name contains "Raj" or email address contains "Raj".
I found this method to get all users - "graphClient.Users.Request().GetAsync();". but, with this method limited response, I am not getting what exactly I want to search.
Thanks,
Shashidhar
Adding to the previous answer: to accomplish this through the Graph C# SDK, use the Filter() method:
graphClient.Users.Request().Filter("startsWith(displayName, 'k')").GetAsync()
You can use other methods on the request to customize the request, e.g. Select(), etc.
According to your description, I assume you want to search the users by using the search parameters.
Based on this document, we can currently search only message and person collections.
And I have tried the filter query parameter, the parameter is currently not supported the contains operator from this document. So if you want to search the user with name or the email address, we can use the startswith operator only.Like this:
https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'k') or startswith(mail,'k')
It will find the user's diplayName or mail which is start with the k

Google Place search API with pageToken returns same record

I'm listing out restaurants, bars and pubs near by I used "pageToken" as I need more place records.
I faced two issues as
1 My URL is not accepting | 'pipeline' symbol.
I tried encoding URL but its not working so Just encode | as "%7C" is this correct way?
2 I just tied to list outs only restaurant and use next_page_token while calling next time the API to load more records.
My URL is something like
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=19.0176147,72.8561644&rankby=distance&type=restaurant&key=[MY_APP_KEY]&pageToken=CpQCCQEAAPqnEctK9cCPZtPWY8NnnBSyzCwsmO_MsTZBaIUeEkO6g_7rsw97tY-bMsBY0d0Rjw61zD-Peaos4wMVZTe7TrZhB-GVfpr6ya847qB0t1C_2Qgxe3Abur1YmRW_fop0Ro5bwIkxOjMI2Gh19D1IYGPOZ7qqv1oM3B7P4lHZ59yFwXEhMbMZUvQSiuVyoDKQ-FXQB9FMCGkGkbllH9ZzIm-38_XG4ZsFMOYKHhdhp3hkCiLVc8SwLO01t-Bq1emptTQfHUUtXXcCWEFCFClpkJlw0rRnW2fRXuxEy25nFZlqrNxHgcifA6v_xq7Jfb5J5FDTCT4FSurAa1MUXYCPW3fPri-7n9CpZwzZDp7wUOUPEhBByQSF6FAegW_gFyc4Q9PqGhSqewBPNa7pLMTWLFJR94IfhPPqpg
But its returning same records on every request, I have verified that pageToken is getting changed in every request.
Can you please let me know where I made mistake?
You are passing wrong key pageToken. Change it to pagetoken and it will work.
Please refer this link for further information: https://developers.google.com/places/web-service/search

verifying a single attendee with email

Is there a method to return a specific attendee's information by sending:
1) the attendee's email address
2) my user_key
3) my app_key
I could do this by searching the returned xml from this "event_list_attendees" method, however, I would prefer to only receive the one result (not hundreds for each call).
Note: I work on the platform team at Eventbrite
Currently there is no way to search for a specific attendee with event_list_attendees.
However, you can cut down on the amount of data returned by paging through the results until you have found the attendee or using the modified_after parameter if you know when the user was last updated: http://developer.eventbrite.com/doc/events/event_list_attendees/
I realize this limitation is non-ideal. We're actively working on building a new API which is more RESTful and does not have issues like this.

How to track type-ahead internal search in SiteCatalyst

I'm planning out how to track internal search data in Omniture/SiteCatalyst.
It's a fairly straight-forward plan for a standard "enter a term and get a page of results" model: set sProps and eVars with the terms, the count of results, and the page searched from, then fire a success event for searching and another for clicking a search result.
For a type-ahead search--where the user is given search results as they type in a search bar--what's a good strategy for handling the timing of event submissions so that you don't end up with different events/entries for letters 4, 5, 6, and 7 of a search term's entry?
Our solution was to leverage a delay on the autocomplete to reduce the number of calls. From a tracking standpoint, if someone pauses for 1 second (or 500 ms, whatever), then they're probably actually waiting for the autocomplete results, and that constitutes a valid search.
From a technical standpoint, we leveraged the delay option on the jQuery UI widget.
Strategy I've always used is to not track the "auto-complete" search features..put the tracking on the search results page same as normal. Or are you saying the whole search results page is being output as the user types? If that is the case...one thing you could do is write some code to pop the Omniture code when the search field loses focus.
Another thing you can do is as the visitor is typing in the search bar, on each keypress, write the current value to a cookie. Then have some code that runs on page load to look for that cookie and if it exists, pop the Omniture search variables and erase the cookie. Alternatively you can keep track of current value w/ a server-side session variable since I assume this thing is ajax driven, and output the omn code w/ server-side code if session var exists. These methods would mean that the search events and vars would not pop on the search results page...this probably isn't that big a deal, unless you have supporting variables you pop, like an "internal search referrer" prop/eVar that keeps track of the previous page the visitor was on (or the page the visitor was on when they performed the search). So you'll have to keep that in mind and carry that over as well.
Whenever you do a search you might be aware of the concept that query string parameter get added at the end of URL.
Suppose www.stackoverfow.com is website and when are you performing a search on it then it will be like www.stackoverflow.com?q=yourname , yourname is the searchkeyword.This keyword we can capture in sitecatalyst.
you can see google.com while searching on internet for sitecatalyst is ---
www.google.co.in/search?q=sitecatalyst
In the same way we can use query string parameter as q = something.
after doing all this thing we can use the plugin getQueryParam in plugin section of the s_code library file to fetch that variable and store that in sitecatalyst variable...
example:-
function s_doPlugins(s) {
var one = s.getQueryParam("q");
if(one)
s.eVar1=one;
}
s.doPlugins=s_doPlugins
insert this below code outside plugin section
/*
* Returns the value of a specified query string parameter, if found in the current page URL.
*/
s.getQueryParam=new Function("p","d","u",""
+"var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.locati"
+"on);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p"
+".length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-"
+"1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i="
+"=p.length?i:i+1)}return v");
s.p_gpv=new Function("k","u",""
+"var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v"
+"=s.pt(q,'&','p_gvf',k)}return v");
s.p_gvf=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T"
+"rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s."
+"epa(v)}return ''");
you will find that it will capture your search results
please let me know in case of more clarifications

Resources