How to test Google Plus account existance - google-api

I am building a website where a user could specify his social accounts links, I am trying to find a way to test if a google plus account actually exists (social account validation).
I've seen that it is actually possible to test using the GET people/userId but what about curtom urls ? For example if a user has a google.com/+JohnDoe , how would you figure it out? I didn't find anything in the google docs.

It's the same API. GET people/userId and GET people/+JohnDoe both work.

i think google never publish users info or google's huge database, because spammers are searching very hard to that API (for advertising,....)
but you can implement this algorithm:
save ID as string (for example id="mohsensolhnia" or 21 digit number)
redirect to "http://plus.googleapis.com/wm/4/+"+id+"/posts"
if link was wrong you will redirect to "error 404 page"(google page not found) (title is "Error 404 (Not Found)!!1" ;D ;D )
you can do above 3 step with C#/java/phyton/... "selenium webdriver" dll very easy.

Related

Google Assistant (Google Home): dynamic response based on web query

I use an Google Assistant (Google Home) and would have an answer, which my Website gives.
For Example:
- I say: Hey Google, buy 3 Eggs
- my Website is beeing called (Webhook/wget/etc.):
http://url.de/befehl.php?befehl=buy 3 Eggs
or without keyword
http://url.de/befehl.php?befehl=3 Eggs
my Website gives following text/content: ok that was successful
Google simply says this text, which he got from Website: ok that was successful
IFTTT can only send a command to Website (Webhook) and lets google speak a fixed answer, but not dynamic answer.
Is it possible to realize that (IFTTT, Olisto, etc.) ?
It would be possible to run a Script, which itself gets the content/text of an Website and says what the Website gives (IFTTT-Webhook could do this, but says always the same text (not dynamic)).
Any Ideas, Tipps, Tricks?
Greetings,
Niko
It is definitely possible. You don't really need IFTTT.
I'll give you an example with something I am working on. I would assume you are working on Dialogflow to build your voice app.
Important: Calls outside the google network only work from an enterprise app NOT from the free version
You can just make a call from dialogflow like this for example:
const response = axios.post(...);
conv.ask(response.speech);
That is assuming your response from the server looks something like this:
{
status: 200,
speech: "ok that was successful",
response: "ok that was successful"
}

Google Drive API Console: Error saving Drive UI integration page

I have a webapp in production that interacts with Google Drive through Google Drive API.
I need to change some settings in Drive interaction but I can't save.
When I save the Drive UI integration page, I receive this error:
There's a problem at our end.
Please try again. If the problem persists, please let us know using
the "Send feedback" link below. Thanks!
(spying Network console: there is an Internal Server Error in a POST call)
I tried to send feedback for months: nobody answers and the bug is still there.
I tried also to create another project: I can save the first time but then the bug returns.
How can I do? Has someone the same problem?
Is there a way to receive a reply from Google? Is there some workaround?
Thank you.
i think that problem must be Client ID
before adding Client ID, go to the Credentials -> OAuth 2.0 Client IDs
then select edit your Client ID. after that your production site url add to Authorized JavaScript origins and Authorized redirect URIs.
then enter your Client ID in Drive UI integration page
For myself trying to get the Drive UI configured I noticed a couple of errors (that don't have any specific error messages)
When adding in an Open URL it has to be a valid domain, so for instance I tried to test it out with local host, to no avail. However something like https://devbox.app.com worked, but something like https://localhost:8888 does not. Even though https://localhost is a valid javascript origin in the client_id configuration (at least for the app I am working on, not sure about other apps), localhost doesn't work as an open URL.
When adding in the mimeTypes it needs to be in the format */* and can include custom mimeTypes like application/custom+xml and application/custom-name+json not sure for other custom types that are not in a particular format like xml or json. Also not sure about wildcards.
When adding in file extensions do not add in the '.' just the name of the file extension.
The app icon I found only failed to upload the image when the image wasn't the exact dimensions, I actually ended up editing some icons in photoshop to change the pixel x pixel values as a quick work around during dev.
That worked for me to get it to save and I tested it with a file that had a custom mimeType (application/custom-name+xml specifically) and custom file extension!

Google picker does not work without filter being applied for some users

we have an integrated with google picker(read-only scope,Docs view) it use to work fine but recently some users are getting blank screens as soon as the pop up shows but when they select some filter everything starts working fine after that no problems.
using developer tools i see all apis returning 200 for that first request
but there were no docs in response(i believe this is the api responsible for bringing docs in picker 'https://docs.google.com/picker/pvr')
when there are no docs returned in above api google is calling another api i assume it is to log error's probably(//docs.google.com/picker/ohnoes)
this api has following error params in it
&error=Cached and requested query mismatch
&line=Not available
&viewToken=["all",null,{"query":null}]
&ms=97
&transferDocs=false
&numErrors=1
has anybody else faced the similar problem
what do error "Cached and requested query mismatch" means in context of drive docs
Fyi - most accounts facing this problem seems like are of company domain for ex "jondoe#company.org"(this is a google account with company domain)
Filters Image
Thanks for your help.
not sure but looks like issue was may be related to google bug
https://issuetracker.google.com/issues/64825685
for me the code that was not working was:
addView(google.picker.ViewId.DOCS)
replaced this code with below code which works as expected
var view = new google.picker.DocsView();
view.setIncludeFolders(true).setOwnedByMe(true).setParent('root');
addView(view).

Gmail contextual gadget

I guess question one is - is it actually possible to create a contextual gadget for gmail right now?
I have spent the last 2 days solid reading the (very out of date) documentation backwards and forwards, and every forum post I could find on the topic. I have tried everything I and see nothing, not even a hint of an error message that might point me in the right direction.
These are the steps I have been following, starting at the start, and going step by step when logged into my google apps domain as admin.
1) In google drive, created a new TestGadget.xml file, shared it publicly across the whole web and copied the contents of the Hello World example code from here https://developers.google.com/gmail/contextual_gadgets into it.
2) In https://console.developers.google.com deleted the previous attempts and created a new project and named it.
3) Once project was created, went to API's (6 were already enabled, have also tried with them removed), clicked Google Apps Marketplace SDK and enabled it.
4) Once enabled, went to API Configuration for Google Apps Marketplace SDK, and go to original console.
now in the apis console -
5) Clicked API Access, then clicked the big blue "Create an OAuth 2.0 client ID"
6) Gave it a name (used the same name as the project, not sure if that matters?) then next, and created clientID settings for both Web Application and Service Account (not really sure what a contextual gadget needs).
7) Went to Google Apps Marketplace SDK options.
Added a description
Added 4 icons
Cleared the checkbox for "Allow individual install"
Added a URL (http://www.google.com) for the TOS just to keep it happy
8) In the extensions section, checked the Universal Navigation Extension, and again pointed it at www.google.com (have to have either this or the drive extension, but neither make sense for a contextual gadget?!)
9) Enabled COB extension.
Extractor URL - google.com:HelloWorld
Gadget URL - https://drive.google.com/file/d/0B9LL5RYGoC4GUUFFU1FtOXpWSms
Param Name - hello (have tried #hello, and other combination too just incase)
Param Value - .*
Scopes - Mail - Subject line, Mail - Message Body
and Saved changes. In other attempts I have tried different extractors from the documentation, and changed the gadget code to match, using the param name specified there e.g google.com:EmailBodyExtractor with email_body and always .* for the value
10) Click Test installation flow , get the grants page appear, agree to conditions, turn ON for my domain, and accept. Then click next next next thru the next bit agreeing to send notifications out.
11) Went to https://admin.google.com/AdminHome?fral=1#AppsList:serviceType=MARKETPLACE , and the app was listed there. Checked the settings, and Data access was granted, and it was ON for everyone.
12) Sent myself an email from a different account sprinkled liberally with 'hello world' in the subject and body.
13) Logged into gmail with https://mail.google.com/mail/u/0/?nogadgetcache=1
... and nothing
14) Bang head against wall. HARD !
15) repeat last 2 steps with a non admin user - still nothing (and no notification of the app either)
16) return to wall . . . . .
What am I missing?
Finally got it working.
The problem was hosting/linking to the gadget on google drive.
With the exact example above, I ftp'd the gadget to my website and linked to it there, and it all started working.
This however is a really annoying way to work, and I have seen a lot of other examples that claimed to use a document on google drive, so is there a proper way to use google drive to host a gadget during development?

MOSS search crawl fails with "Access is denied ..."

Recently the search crawler stopped working on my MOSS installation. The message in the crawl log is
Access is denied. Check that the Default Content Access Account has access to this content, or add a crawl rule to crawl this content. (The item was deleted because it was either not found or the crawler was denied access to it.)
The default content account is an admin on the site collection that I am trying to crawl.
Almost every result for this error on Google tells me to add the DisableLoobackCheck registry key with a value of 1. I have done this and rebooted and the error continues.
The "Do not allow Basic Authentication" checkbox in my crawl rule screen is unchecked.
Is there anything else that could be causing this error? Something with file system or database permissions maybe?
Edit: All signs seem to indicate that the "DisableLoopbackCheck" should fix this, but it doesn't seem to work. Could I be doing something wrong when I enable this?
I'm doing it in My Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa, where I create a new DWORD key called DisableLoopbackCheck and give it the hex value 1.
It turned out not to be related to DisableLoopbackCheck. The problem was that the search was accessing the site through its external URL. You are supposedly not supposed to be able to access a site from within a server using the same URL that you use to reach it from the outside, at least in pre-SP1 MOSS. But I was doing this for about two years somehow. MS Support tells me they don't quite understand how it was ever working. So it looks like I ran into an issue that should have been manifesting all along. I'm not sure what caused it to appear suddenly, maybe some routine patching of the server. The solution was to extend the web application so it was accessible internally through the machine name, then point the crawler at that.

Resources