How to read YouTube channel? - iphone

I have just started developing using Youtube API and stuck in very beginning. I want to know how we can read a channel on Youtube. Means what should I do to read data present on any channel.
Should I use a url and post request on this url.
Or is there any method in the Youtube API calling which i can get the data on a channel.
Please help me folks. I am having no idea from where I should start.

To retrieve information about a channel you should be using YouTube's GData API's.
The link below shows the sample request you should be making to search for and retrieve channel information:
http://code.google.com/apis/youtube/2.0/developers_guide_protocol_channel_search.html
There's also a really nice demo page for these GData calls where you can try out all sorts of requests, check how they are constructed and what they return:
http://gdata.youtube.com/demo/index.html
It's all XML based so you'll need to up your DOM/SAX parser skills. :)
Finally, if you are developing in Java, Python or a few other languages, YouTube already provides some implementations for the parsing and requesting here:
http://code.google.com/apis/youtube/code.html

Related

Embed Facebook Live video comments on page

I am using Facebook Live inside of a web app to live stream videos. I am wondering if it is possible to include the live commenting associated with the video on my site in real time. I know I can grab the comments from the graph API, however this is not real time. The comment embed widget is also not real time and would need to be constantly refreshed.
The documentation says :
"You can read live video comments by polling the Live Video
Comments
edge."
What is polling? How do I do this and is it possible from a front end web app.
Basically my question is how do I include the live comments along with Facebook Live video on my own website.
This is now available via SSE streams
https://developers.facebook.com/docs/graph-api/server-sent-events/endpoints/live-comments
I know I can grab the comments from the graph API, however this is not real time.
This is as real time as it can get. If someone posts a comment and you immediately query the Graph API, you will see their comment.
What is polling?
As there is currently no streaming data endpoint for comments, you must query the comments on the live video repeatedly. That is, every 2 seconds or so, refresh the data.
This is done by making a Graph API GET request for /{video-id}/comments. I also suggest setting "order": "reverse_chronological" in the parameters so that you get the newest comments first.
You can see some sample code for doing this as part of the Live Comments Teleprompter: https://github.com/fbsamples/live-comments-teleprompter/blob/master/js/main.js#L89-L103

How to use Google Api to upload to a single Youtube channel on a User-less app

I'm building an app that will allow users to upload videos to my Youtube channel. I have checked online about using Google Api to access the data/upload videos, but all references and examples seem to assume videos will be uploaded to the user's youtube channel, hence the process always involves using OAuth to gain approval from the user.
However, in my case the only youtube channel all users will access is mine. And I'm not even asking them to create an account on my app to upload the videos. Is there a way to do this directly from the app.
My app is an iOS app, but if you have a solution in any other language, I welcome your suggestion.
Thanks in advance
I had the same problem not so long ago. Youtube Documentation doesnt make it easy. Even though you getting access to your own Youtube channel, You still need to be authenticated using OAuth. Google makes hard for you to be vulnerable to attacks.
My solution is using a server side(API) application. What you can then do is make your iOS app hit the API.
So the tricky thing is getting the refresh token. Its hardly documented anywhere. What you can then do is follow documentation of your preferred language for the API.
The documentation can be found here https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps
Get the Refresh token:
Step 1 : Hit this url in the browser https://accounts.google.com/o/oauth2/auth?client_id=ClientID_Here&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://gdata.youtube.com&response_type=code&access_type=offline
It will make you log in using your youtube credential which is your google account.
You will then have to agree for google to access your account by clicking allow.
At the end it will give you a code.
Step 2 : You should then authenticate using a clientless platform.
(eg instead of browser) Use curl instead. (There plenty of 3 minute tutorials on how to use curl)
Hit this url endpoint :
curl https://accounts.google.com/o/oauth2/token -d "code=CodeFromGoogleOAuth&client_id=ClientIDHere&client_secret=ClientSecretHere&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code"
You should then get a refresh token in the response.
There are alot of examples of how to upload from then on like
https://developers.google.com/youtube/v3/code_samples/dotnet
In the example above you have to avoid using the GoogleWebAuthorizationBroker use Googles one instead. Look for RefreshToken Field
It is not possible to allow third parties to upload videos to a single YouTube account with the YouTube Data API, and that is by design. See this Google Blog, explaining "It’s tempting to design a system in which all videos are uploaded to a single “master” YouTube account, but this is always the wrong approach."
A potential workaround is to use YouTube Direct Lite, which allows you to easily build and moderate a playlist on your YouTube account comprised of videos uploaded by your users on their accounts.

Upload image from as3 to instagram/facebook

I'm planning to create a photo booth program using AS3. I'm searching for this questions but can't find any solution so i just want to clarify it here if it is possible or not.
My questions are:
1.It is possible to post an image from AS3 to Instagram using my account?
2.It is possible to post an image from AS3 to Facebook page?
Thank you.
Facebook - Yes,
https://code.google.com/p/facebook-actionscript-api/
http://www.adobe.com/devnet/games/articles/getting-started-with-facebooksdk-actionscript3.html
Instagram - Maybe.
I found This, which is a library for instagram to AS3 communication, but I am unsure on how well it handles.
You can test your code for Instagram's API here
I would suggest that you check the Instagram api console here:http://instagram.com/developer/api-console/
They are listing every available api calls,after getting what you need it is a matter of using a URLLoader with URLVariables that contains all the HTTP vars the console shows and of course with the access token.
All the API is Rest .

Sending Facebook app request using Tornado Framework

I am a student majoring in CS and very newbie to Facebook app development. I couldn't find any good resources online so, I was wondering how can I send an app request or a message using python tornado framework to targeted user? So far, I have my app access token but I couldn't get app request to work... I need some kind of reference to follow but I am not having good time finding one that is "SIMPLE" enough... Thanks!
Regardless of the backend framework, doing app invites is all client-side, so as long as you can stream out HTML from your server with the correct Javascript, then you'll be well on your way.
See: http://developers.facebook.com/docs/reference/dialogs/requests/ For information and examples can be found and played with in Javascript tool at: http://developers.facebook.com/tools/console/ click Examples, then click apprequests

Setting up an x-callback url

I need to do this for the Soundcloud API and I have no idea what this is about or how to do it. There is a form on the Soundcloud API Developer website where you save your callback URL, but I'm not sure what sort of information I should input there.
Any help?
i believe this callback url is for oauth authentication, correct? i needed to do the same thing for twitter and ended up setting up a custom url scheme for my app (ie appname://oauth) and using this as the callback url.
in case you want to try this, see this article on how to launch your app via a custom url scheme. specifically for twitter, you can see jaanus's post on some implementation details and the github project.
while i haven't integrated with soundcloud, i did find that they have an objective-c api that you may want to check out if you aren't already here.
update
so what i mentioned is true - that you can use a custom url scheme and such to handle the authentication, but it's not exactly required. i found this article which outlines two methods for authentication - the first is for ios4 only and requires very little code. the second should work on 3.x and uses the custom url method i mentioned above (and outlines how to use it to authenticate).
so to answer your question once and for all, i suggest you:
look at this readme for the objective-c soundcloud api.
read this setup guide.
then read this usage guide.
check out this test iphone application.
hope this helps!