I'm trying to retrieve the watch history data of my own Youtube account using the Youtube Javascript API. I am using the auth.js listed here.
I have made everything work, but it requires authorization (website asks you to login with a Google account so other people cannot view what i'm displaying without logging into my Youtube account).
I'm looking for a way for a website to display my Youtube history data without authorization. Reading similar questions here and googling seems to suggest that it's not possible with just Google Client API. If anyone knows a way to do this or where I should look for, please let me know. I'm new to web stuff so any help will be appreciated!
Thanks
Very simple answer: It can not do without Authorization
You can do that in different way
after Authorization you can sync your youtube history with another database and show that data from fetching from that database to others
Related
I am working on a site that will allow users to create an account. Then website developers will be able to integrate that authentication system into their site and allow users to login with my sites login credentials. I am wanting to do it similar to the way facebook connect, Google, twitter, Microsoft works.
I have researched alot about this and discovered "Oauth2" which I think is what I need. But I'm not sure about how to use it anyhow. I have downloaded two libraries of oauth2 (Php(server) and Javascript(client)) but don't know where to start.
I simply want functionality where developers create a button which when clicked will send a request to my server and get the user's (who is currently logged in $_session) information from my server database and send it back to the third-party(the developers) client page.
Problem is Its not possible to send session data from server.com to client.net using simple Ajax requests. So I thought oauth2 might be problem to my solution.
So what is it can anyone help me out?
I have already read few of tutorials on oauth2 and nothing suits my needs. So it would be great if someone can show a little working example.
Trying to embed GA report on a third-part website, and I follow the Demo on Google Developers website, although I have some (silly) questions and I'm having trouble figuring it out.
After got clientid and put it my page I got exactly the same page as in google's example.
When I sent the link to someone else, it grabbed the info from the properties from people's GA I sent the link to, not my website.
Can someone help me set the property and eliminate the dropdowns to choose Account, Property, Views?
Thanks,
What you're asking is to do user authorization server-side. This will allow you to show Google Analytics data on your website without requiring your visitors to log in.
You can view the Embed API Service-Side Auth demo to see a working example.
I have a static blog using Jekyll hosted on GitHub. I have set up Google Analytics for it and works well enough.
Now I want to show how many people viewed each post in my blog. I found Google Analytics JavaScript API to get the information. But it seems that this API uses OAuth for data access. So I think this might not be the API I needed.
Is it possible to do so with Google Analytics? I don't have any server since it's hosted on GitHub.
I finally solved this problem by Google Analytics superProxy as suggested in the comment of #EikePierstorff.
I wrote a blog on it.
Here's the main idea.
I first build a project on Google App Engile, with which I authenticate for the access of my Google Analytics. Then a URL of query (which can be pageview of certain pages) is generated in JSON format. I can set the refresh rate on this GAE project so that the JSON file can be updated from Google Analytic.
Sounds almost perfect to me. Thank you all guys for help!
You can't query the Google Analytics API without authorization by someone, that's the most important thing to remember.
It's certainly possible to display Google Analytics data on your website to users who don't have access to your account, but in order to do that, someone with access to the account needs to authorize and get an access token in order to run queries.
Normally this is done server side, and once you have a valid access token you can query the API client side (to display charts and graph, etc.). Access tokens are typically valid for 1 hour, so if you want to have your website up all the time, you'll also have to deal with refreshing the access token once it expires.
Now, since you're using Github Pages and don't have a back end, which means all the authorization will need to happen client side. While it's technically possible to do the same thing client side as server side, it's generally not a good idea because private data like your client secret, refresh token, etc. will be visible in the source code.
Applications that do auth client side typically don't authorize on behalf of a user. They require the users themselves to go through an auth flow for security reasons (as I just explained), but that would mean those users 1) have to log in, and 2) can only see the analytics data they have access to, which probably isn't what you want.
--
What you can do is run reports periodically yourself and export that data to a Google Spreadsheet. Google Spreadsheets allow you to embed charts and graphs of data as an <iframe> in external pages, so that might be an option.
At the end of the day, if you can't authorize server side you'll have to come up with some kind of workaround to make this happen.
Here are a few possibly helpful links that might point you in the right direction:
https://developers.google.com/analytics/solutions/google-analytics-spreadsheet-add-on
https://developers.google.com/analytics/devguides/reporting/embed
https://developers.google.com/analytics/solutions/report-automation-magic
I develop mobile websites for my clients. This particular client would like some facebook wall activity to be displayed on the website. I have looked into the facebook graph api and am getting confused on authentication.
I need the blah in https://graphs.facebook.com/clientsfacebookid/feed?access_token=blah
in order to grab the info i want. I read about authentication and all of that but it doesn't seem to serve my purposes.. For example a lot of the stuff I read about getting a token is related to creating apps and stuff - which is not what I'm trying to do. A lot of ways to authenticate redirect users to log in or grant access to the information but this also doesn't seem like it fits my scenario.
Should I just talk to my client and get them to send me an access code or set up some stream so I can grab an updated access code anytime I need it OR is there some built in functionality in the API that I could benefit from using.
Any thoughts?
P.S. I am trying to implement this via an ajax call in javascript.
Thanks!
What you'll need to do is create a Facebook App and have your client add this to their page. You can then get an OAuth token for this app and use it to query the client's feed. See the Facebook documentation for authenticating as an app for details.
It's actually far simpler if you just want to grab the data from the page. Create an App, but you don't need to add it to the actual page. You can generate an App Access Token by following the instruction on the Facebook Developer Website.
Then, all you need to do is call the Graph API with the generated access_token. E.g.:
https://graph.facebook.com/{page_id}/feed?access_token={app_access_token}
You can then use the data returned by Facebook to display selected posts from the page.
The Page Admin doesn't need to add the app to the page, and this method can be used to scrape any published page. The posts on Pages is public anyway, you just need an access_token to access the page.
If you want a simple way to learn and have an example of a working model try out fourgefeed.com its a simple framework with a simple to implement example kinda like jquery.
I have been asked to integrate facebook chat in my application using javascript. I went through the chat api but that needs a domain url. I have to integrate the chat without the domain or the site url. I tried populating the online friends list through graph api, and I am able to successfully authenticate using the client flow example, but it does not redirect to my local host: http://localhost:8090/chatplugin/success.html. An error pops up telling me the resource is not found.
Is it possible to integrate FB chat using the graph api? I'm new to FB apis and I need more info.
Thanks:)
Short answer: no.
Longer answer: The Graph API lets you access all the information that is stored in Facebook's social graph; the social graph is the giant web that keeps all the information on people, events, messages, etc. Chat isn't part of the graph, it's a separate application, that also uses info from the graph to populate it.
While there may be other ways to sneak around (which I don't know), the Graph api doesn't provide what you need.
Please see the API available on Facebook API.
https://developers.facebook.com/docs/chat/