Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding > Coding Tutorials
You last visited: Today at 07:18

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

Advertisement



[C# Tutorial]How to post comment to YouTube with Form Application

Discussion on [C# Tutorial]How to post comment to YouTube with Form Application 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
Wink [C# Tutorial]How to post comment to YouTube with Form Application

Hello everybody. I'm gonna show you how to post comment to youtube videos only with a button. First we must register an api to do it. So please go to:

Quote:
You will see a screen like that :



Please click to that button to create a new API for Google.

If you clicked to "Create Project" button, Google will make it.

You will see 4 options these named : Overview, Services, Team and API Access

Please enter to API Access tab:



Then click to "Create an OAuth 2.0 cliend ID" button.

Fill up all forms like that(You can put the name what you want) :





Then click to "Create client ID". After that, go to API Access again:



Please open a new notepad and save them :

Quote:
App Name : you commenter
Dev Key : xxxx
Now open Visual Studio and create a new form application.



Prepare your design. Because in programming, design is first:

(mm... it is enough xD)


Now we will add some references to the project. First download these libraries:

Quote:
and add these two libraries to your project(I won't do explain that how to add library to a project as reference).

and add this code start of Form.cs:

HTML Code:
using Google.YouTube;
Now create button_click event and add these:

PHP Code:
YouTubeRequestSettings settings = new YouTubeRequestSettings("app name""dev key"textBox1.TexttextBox2.Text);
YouTubeRequest request = new YouTubeRequest(settings); 
We prepared our request. We will use it to post comment. textBox1.Text is google username of user and textBox2.Text is password of the account.

Now let's prepare our objects. Whare are they? Video and Comment.

PHP Code:
Uri videoUrl = new Uri("http://gdata.youtube.com/feeds/api/videos/" textBox3.Text);
Video video request.Retrieve<Video>(videoUrl); 
With these codes, we got our video object. textBox3.Text is our video ID. So it is red marked in following:

Quote:
youtube.com/watch?v=hO2wA0Te0wM
Last one is Comment. It is just like that :

PHP Code:
Comment comment = new Comment();
comment.Content richTextBox1.Text
Now let's start to post comment :

PHP Code:
request.AddComment(videocomment); 
And press F5 to start project :



Result :



Done !
Naworia is offline  
Thanks
2 Users
Old 01/02/2013, 05:26   #2
 
elite*gold: 0
Join Date: Jun 2011
Posts: 272
Received Thanks: 75
Thanks bro helped a lot . . .
mayur_kulkarni is offline  
Old 01/02/2013, 09:01   #3


 
elite*gold: 0
Join Date: Feb 2010
Posts: 7,220
Received Thanks: 6,758
With a library it's not very difficulty, but still thanks.
#SoNiice is offline  
Old 01/02/2013, 12:38   #4
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,811

C&P-Code for every function.
Kraizy​ is offline  
Reply

Tags
api, c#, form, tutorial, youtube


Similar Threads Similar Threads
C# Windows Form Application How To Save And Run As Application?
02/18/2010 - CO2 Private Server - 4 Replies
How can I save the project and run it as a exe and not .resx or whatever?



All times are GMT +1. The time now is 07:18.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.