Note that there are some explanatory texts on larger screens.

plurals
  1. POGrabbing Info from YouTube Vid w/ Javascript (Code Needs Refining)
    primarykey
    data
    text
    <p>I'm working on a community video site (Wordpress backbone) that will allow users to simply submit a link and have all the info on the site. I have the main parts working (filtering video ID and planting value into javascript functions which grab view count). I'm trying to grab the uploader of the video, but for some reason it doesn't seem to be working (works on my other site, ?). Here's a snippet of my code:</p> <p><em>Assume video ID is '3DdQw4w9WgXcQ'</em></p> <pre><code> //Here is the player (separate from JS, used PHP) &lt;iframe width="802" height="480" src="http://www.youtube.com/embed/3DdQw4w9WgXcQ" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; //Here is where I want the uploader to display, if the function doesn't execute correctly, it displays a common message, "Error" &lt;div id="postedby"&gt;Error&lt;/div&gt; &lt;script type="text/javascript"&gt; function youtubeVidCallback( data ) { document.writeln( '&lt;h3&gt;&lt;strong&gt;' + addCommas( data.entry[ "yt$statistics" ].viewCount ) ); $('#postedby').html( 'Posted by' + data.entry[ "author" ][ 0 ].name.$t ); } &lt;/script&gt; //This next part loads YouTube's feed and gets the script rolling &lt;script type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos/3DdQw4w9WgXcQ?v=2&amp;amp;alt=json-in-script&amp;amp;callback=youtubeVidCallback"&gt;&lt;/script&gt; </code></pre> <p>My goal is to enable this so that I can make subscription links back to the video author's channel and possibly load their avatar. Thanks in advance! Matt</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload