Jump to content

I need help with feedburner script.


inferno885

Recommended Posts

I want to code a script, that will automatically add a feed from my website to feedburner, here is the steps that needs to happen. 

 

step one: login to google 

 

step two: add a feed

nvbnfq.png

post fields = sourceUrl

 

step three: enter in feed details

28le5px.jpg

 

post fields, name, mappedUri

 

curl basic syntax, this is the way I think I am going to have to code this.

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, 1);
// Edit: prior variable $postFields should be $postfields;
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
Edited by inferno885
Link to comment
Share on other sites

I see, you want to allow a user or yourself to post their channel and they collect on your site?

 

Let me say in a nutshell that lots changed since the api version 2 was deprecated, most everything youtube wants you to access through api version 3.

Youtube no longer supports the old feeds as of April 2015

https://docs.google.com/presentation/d/1ZBCl6MGc4-JZYVbaq0z-CB8Uxh3nzgkOmMOVkM5eCdQ/edit?pli=1#slide=id.g9ca1da998_0_4

 

Feedburner will throw errors on many feeds.

 

Here is a good example.

https://www.youtube.com/user/JimmyKimmelLive

https://www.youtube.com/feeds/videos.xml?channel_id=JimmyKimmelLive

 

It's actually this that can find in the source of the page.

https://www.youtube.com/feeds/videos.xml?channel_id=UCa6vGFO9ty8v5KZJXQxdhaw

 

<link rel="alternate" type="application/rss+xml" title="RSS" href="https://www.youtube.com/feeds/videos.xml?channel_id=UCa6vGFO9ty8v5KZJXQxdhaw">

 

 

There is still a few ways can go about it. If the channel is a vanity url, have to visit the page and discover the actual url, the feed url is in the source of the page.

Something like simplepie can discover the new url and get this content.

 

Alternately you can extract user,video or playlist id's and visit them directly with following types of urls I have below.

Parse it with dom, simplexml is the best bet, although you can scrape the page other methods like curl/file_get_contents, preg_match

 

user channel feed:

https://www.youtube.com/feeds/videos.xml?channel_id=UC-rYhqY2vWalkWSPGhYFZHA

playlist feed:

https://www.youtube.com/feeds/videos.xml?playlist_id=PLs4hTtftqnlDb1HQ1cbYkwyVTB5X3p7v5

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.