Wednesday, September 21, 2011

[YouTube-API] Re: You tube Insight data

Hello Kapil,

This C# code assumes that you already have an authenticated
YouTubeRequest object named "request". It also assumes that you have a
String videoId that corresponds to a video belonging in the
authenticated account.

Uri videoEntryUrl = new Uri("http://gdata.youtube.com/feeds/api/users/
default/uploads/
" + videoId);
Video video = request.Retrieve<Video>(videoEntryUrl);
foreach (AtomLink link in video.YouTubeEntry.Links)
{
if (link.Rel == "http://gdata.youtube.com/schemas/
2007#insight.views
")
{
WebClient webClient = new WebClient();
webClient.DownloadFile(link.HRef.Content,
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
"insight.zip"));
}
}

It will download the Insight data in a zip archive to your desktop,
called insight.zip. It's up to you to decompress the zip archive and
process the CSV file inside.

Cheers,
-Jeff Posnick, YouTube API Team
groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
@YouTubeDev


On Sep 20, 2:32 am, kapil rajawat <kapil1...@gmail.com> wrote:
> I am trying to get you tube insight data using youtube API but unable
> to get it.
> please help ....
> if any one have sample code then plz send it....

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment