Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding > Coding Tutorials
You last visited: Today at 01:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[C#]How to rate youtube videos

Discussion on [C#]How to rate youtube videos within the Coding Tutorials forum part of the General Coding category.

Reply
 
Old   #1
 
Naworia's Avatar
 
elite*gold: 12
Join Date: Aug 2011
Posts: 455
Received Thanks: 418
Cool [C#]How to rate youtube videos

Hello guys, in this tutorial I will show you how to rate specific youtube video with Google libraries for C#.

First you should submit an application to google.
So go to this link :
and create a project.

Note : I don't show you how to create project in google. So you can see some tutorials about it. It is really easy.

So as I said, we will use Google libraries to obtain some functions.
You can get these libraries from :

Add all libraries to your project and make this references:
Code:
using Google.GData.Client;
using Google.YouTube;
Put a button to your form. So when you click to button, it will rate video.
Add these codes to your button_click event:

Code:
YouTubeRequestSettings settings = new YouTubeRequestSettings("appname", "devkey", "account mail", "account pw");
YouTubeRequest request = new YouTubeRequest(settings);
We created our request object. We will use this to requesting datas to/from server.

What does need the object that named "request"? Video ID and rating count.
So we need specify video ID from video url.

Code:
Uri videoUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" + "videoID");
We will get videos from google server so we don't need full youtube url.

If you don't know that what is youtube video ID, it is like it:
Quote:
www.youtube.com/watch?v=XMb63nsvQMo

Red colored text is the ID.
Now we should create video object that holding the video informations.

Code:
Video video = request.Retrieve<Video>(videoUrl);
We just need to specify rating count. Do it like this:

Code:
video.Rating = 5
Ratings can be [1,2,3,4,5].

We did all we need. Except doing request to server.

Code:
request.Insert(video.RatingsUri, video);
Click to button that you created before, and done!

Please send message or come skype if you troubled with this tutorial.
Naworia is offline  
Thanks
4 Users
Old 10/22/2012, 00:26   #2
 
elite*gold: 0
Join Date: Oct 2012
Posts: 7
Received Thanks: 5
I think it's can be so nice but please can you do a movie ?
Thanks in advance
NoCheаtImPGM is offline  
Thanks
1 User
Old 10/22/2012, 14:08   #3
 
Naworia's Avatar
 
elite*gold: 12
Join Date: Aug 2011
Posts: 455
Received Thanks: 418
I just will think it but i think i will not do.
Naworia is offline  
Reply


Similar Threads Similar Threads
[HowTo]Geld verdienen mit Deinen YouTube Videos [Ohne YouTube Partnerschaft]
10/26/2012 - Tutorials - 59 Replies
Da mein alter Therad auf Grund eines Videotutorials Gesperrt wurde, schreibe ich nun ein Tutorial für euch. Es handelt sich dadrum, das auch ihr ohne YouTube Partnerschaft Geld verdienen könnt. Sowas ist mittlerweile sehr einfach, und eigentlich sollte es auch jeder verstehen.
Youtube Videos immer wieder wiederholen l Youtube Video l OmGeSiuM
10/10/2012 - Tutorials - 7 Replies
Hallo Leute in diesem Tutorial will ich euch zeigen wie ihr ganz einfach Youtube Videos wiederholen könnt. Das Video habe ich selber gemacht: TuToRiaL 1: Youtube Videos wiederholen - YouTube
Funny YouTube Videos! Post and Rate!
11/22/2011 - Off Topic - 13 Replies
Hey E*PvPers, Ich möchte nun mal wieder ein kleines Post 'n Rate Thread öffnen. How²: Ihr Postet ein Lustiges Youtube Video und Bewertet das über euch, von einer Skala die von 0(schlecht) bis 10(gut) ist. Mein Video: Jesus Pwn3d U - YouTube Das über mir: Hab keinen über mit :D 0/10 :D



All times are GMT +2. The time now is 01:29.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.