Viewed   105 times

Maybe I am over looking something, but from all the API docs I've looked at theres no mention that I have found as of yet or examples to show if youtube offers channel specific feeds

what I want to do ultimately is with a little bit of php and javascript get all the videos for this particular user

http://www.youtube.com/user/stevesattlerfilms

and then list them out on his site accordingly. So seeing as I am having troubles finding my answers I decided to come here, I figure this may be a repeat question somehow somewhere and if it is I am sorry. But if anyone can point me in the right direction that'd be helpful enough for me. Thanks.

 Answers

3

I would request a video feed and make use of the author parameter. This should give you all the videos of a specific user.

In your example: http://gdata.youtube.com/feeds/api/videos?author=stevesattlerfilms

Tuesday, December 6, 2022
 
3

HMAC is a standard. So is SHA-256. So their outputs, regardless of which implementation, has to be the same.

There could only be differences in the Base64 encoding. Normally, the non-alphanumeric characters are + and /, but you cannot count on that. I've checked, and both implementations use the same non-alphanumeric characters.

However, you should still "manually" check a few thousand strings. The implementation in PHP is well tested. But I do not know if the same is true for the implementation in jQuery...

The syntax for Base64 encoded output is:

Crypto.util.bytesToBase64(
    Crypto.HMAC(Crypto.SHA256, sign, accessKey, { asBytes: true })
);
Thursday, October 27, 2022
 
3

you have to look at the ReverseAJAX or COMET methodologies.

As per wikipedia

Reverse Ajax refers to an Ajax design pattern that uses long-lived HTTP connections to enable low-latency communication between a web server and a browser. Basically it is a way of sending data from client to server and a mechanism for pushing server data back to the browser.

EDIT:

i suggest you to implement the following approach, this is simple to implement. I take answering as an example.

  1. After the answer page load complete. Initiate a AJAX request (Asynchronos, so it wont block the UI)
  2. And it will look for any new updates on the server side (polling the DB to check if any new answers added)
  3. And return the data only to browser, if there is an update. otherwise stay calm.
  4. After returning the data to client, client should invoke the another AJAX request and wait for the updates.
  5. Repeat step 2 to 4 for the rest of the page life time.

Hope this helps.

Sunday, December 25, 2022
 
jacott
 
2

Unfortunately Facebook has removed as you have seen the total count of likes and comments when you look at posts. Instead you need to make another call for each post to retrieve the total likes or comments. Also they have renamed it from count to total_count

Example:

For likes

https://graph.facebook.com/POST_ID/likes/?summary=true

it will return something like this

{
  "data": [
    {
      "id": "xxxx",
      "name": "xxxxx"
    },
    {
      "id": "xxxx",
      "name": "xxxxx"
    },
    {
      "id": "xxxx",
      "name": "xxxxx"
    },
    {
      "id": "xxxx",
      "name": "xxxxx"
    }
  ],
  "paging": {
    "cursors": {
      "after": "NTU2MTU3NjU0",
      "before": "MTA4OTM4NzgwMA=="
    }
  },
  "summary": {
    "total_count": 4
  }
}

For comments:

https://graph.facebook.com/POST_ID/comments/?summary=true

{
  "data": [
    {
      "id": "xxxxx",
      "from": {
        "category": "Media/news/publishing",
        "category_list": [
          {
            "id": "xxxxxx",
            "name": "xxxx"
          },
          {
            "id": "xxxxxx",
            "name": "xxxx"
          }
        ],
        "name": "xxxxx",
        "id": "xxxxx"
      },
      "message": "xxxxxxx",
      "can_remove": false,
      "created_time": "2013-07-03T20:36:54+0000",
      "like_count": 0,
      "user_likes": false
    }
  ],
  "paging": {
    "cursors": {
      "after": "Mg==",
      "before": "Mg=="
    }
  },
  "summary": {
    "order": "ranked",
    "total_count": 2
  }
}
Sunday, September 11, 2022
4

I just came across this question and I notice that its been quite some time when this was asked. But since nobody answered it yet, I think I should do that.

What you should ideally do is, use Youtube's PHP API (using Zend_GData) and use the following code in PHP:

<?php

    require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');

$yt = new Zend_Gdata_YouTube();
$yt->setMajorProtocolVersion(2);
$video = parse_url("http://www.youtube.com/watch?v=K-ob8sr9ZX0");
parse_str(urldecode($video['query']), $query);
$videoId = $query['v'];

$commentFeed = $yt->retrieveAllEntriesForFeed($yt->getVideoCommentFeed($videoId));

foreach ($commentFeed as $commentEntry) {
    echo "Full text: " . $commentEntry->content->text . "<br />";
}

The key element here is the retrieveAllEntriesForFeed() method.

Instead of echo-ing all the comments, you can construct a JSON and send it back to the waiting Javascript.

It does not use the max-results or start-index, but does the job well without them.

Tuesday, September 13, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :