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:
[Only registered and activated users can see links. Click Here To Register...]
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:
[Only registered and activated users can see links. Click Here To Register...]
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) :
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Then click to "Create client ID". After that, go to API Access again:
[Only registered and activated users can see links. Click Here To Register...]
Please open a new notepad and save them :
[Only registered and activated users can see links. Click Here To Register...]
Prepare your design. Because in programming, design is first:
(mm... it is enough xD)
[Only registered and activated users can see links. Click Here To Register...]
Now we will add some references to the project. First download these libraries:
and add this code start of Form.cs:
Now create button_click event and add these:
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.
With these codes, we got our video object. textBox3.Text is our video ID. So it is red marked in following:
Now let's start to post comment :
And press F5 to start project :
[Only registered and activated users can see links. Click Here To Register...]
Result :
[Only registered and activated users can see links. Click Here To Register...]
Done !
You will see a screen like that :Quote:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
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:
[Only registered and activated users can see links. Click Here To Register...]
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) :
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Then click to "Create client ID". After that, go to API Access again:
[Only registered and activated users can see links. Click Here To Register...]
Please open a new notepad and save them :
Now open Visual Studio and create a new form application.Quote:
App Name : you commenter
Dev Key : xxxx
[Only registered and activated users can see links. Click Here To Register...]
Prepare your design. Because in programming, design is first:
(mm... it is enough xD)
[Only registered and activated users can see links. Click Here To Register...]
Now we will add some references to the project. First download these libraries:
and add these two libraries to your project(I won't do explain that how to add library to a project as reference).Quote:
[Only registered and activated users can see links. Click Here To Register...]
and add this code start of Form.cs:
HTML Code:
using Google.YouTube;
PHP Code:
YouTubeRequestSettings settings = new YouTubeRequestSettings("app name", "dev key", textBox1.Text, textBox2.Text);
YouTubeRequest request = new YouTubeRequest(settings);
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);
Last one is Comment. It is just like that :Quote:
youtube.com/watch?v=hO2wA0Te0wM
PHP Code:
Comment comment = new Comment();
comment.Content = richTextBox1.Text;
PHP Code:
request.AddComment(video, comment);
[Only registered and activated users can see links. Click Here To Register...]
Result :
[Only registered and activated users can see links. Click Here To Register...]
Done !