You are viewing our Forum Archives. To view or take place in current topics click here.
Need some help application
Posted:

Need some help applicationPosted:

EMB
  • TTG Senior
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Hey guys, I want to make a application that will go thru the YouTube API, I want it to accept or deny based on certain amount of views. Is this hard to do? please post below!
#2. Posted:
Italic
  • Powerhouse
Status: Offline
Joined: Aug 07, 201013Year Member
Posts: 452
Reputation Power: 19
Status: Offline
Joined: Aug 07, 201013Year Member
Posts: 452
Reputation Power: 19
eww wrote Hey guys, I want to make a application that will go thru the YouTube API, I want it to accept or deny based on certain amount of views. Is this hard to do? please post below!

so if say a person has more than 'X' subs there application will go though, else, if they have less than 'X' subs there application gets denied

if so a simple bit of JavaScript
or you could use python
I'd recommend doing it though JavaScript because you can like it into the website easier
#3. Posted:
Imp
  • Retired Staff
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Status: Offline
Joined: Jan 01, 201113Year Member
Posts: 1,957
Reputation Power: 401
Been looking into this and there is a way of getting Lifetime Views from the new developmental Analytics API

Still looking into exactly how, but if you click on the views on the channel page, it takes you to the analytics page, and shows the data, so it must be possible!
#4. Posted:
Bighair
  • Powerhouse
Status: Offline
Joined: Sep 26, 201013Year Member
Posts: 401
Reputation Power: 17
Status: Offline
Joined: Sep 26, 201013Year Member
Posts: 401
Reputation Power: 17
Views on what? Videos? Channels? :\ I've done a bit of work with the youtube API so if you let me know i will see if i can help
#5. Posted:
EMB
  • TTG Senior
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Sorry for the late response. I am talking about daily views.
#6. Posted:
UnrealEgg
  • Powerhouse
Status: Offline
Joined: May 30, 201013Year Member
Posts: 438
Reputation Power: 49
Status: Offline
Joined: May 30, 201013Year Member
Posts: 438
Reputation Power: 49
There's probably other ways after looking at the YouTube API documentation for a little while. However this is what I would suggest.

You can retrieve an XML document that details information on a given video. Mainly the information you see by default on a video. The URL I am talking about is given on this page: [ Register or Signin to view external links. ]

So for example, the URL would look something like:
https://gdata.youtube.com/feeds/api/videos/XSGBVzeBUbk?v=2


This will then fetch an XML representation of a video with various information. (Ran the XML through a beauitifier)

<?xml version='1.0' encoding='UTF-8'?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:yt="http://gdata.youtube.com/schemas/2007" gd:etag="W/&quot;DE8BQn47eCp7I2A9WhBXEkU.&quot;">
    <id>tag:youtube.com,2008:video:XSGBVzeBUbk</id>
    <published>2009-09-11T16:28:28.000Z</published>
    <updated>2013-03-26T08:34:13.000Z</updated>
    <category scheme="http://schemas.google.com/g/2005#kind" term="http://gdata.youtube.com/schemas/2007#video" />
    <category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Film" label="Film &amp; Animation" />
    <title>Big Buck Bunny animation (1080p HD)</title>
    <content type="application/x-shockwave-flash" src="https://www.youtube.com/v/XSGBVzeBUbk?version=3&amp;f=videos&amp;app=youtube_gdata" />
    <link rel="alternate" type="text/html" href="https://www.youtube.com/watch?v=XSGBVzeBUbk&amp;feature=youtube_gdata" />
    <link rel="http://gdata.youtube.com/schemas/2007#video.responses" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/videos/XSGBVzeBUbk/responses?v=2" />
    <link rel="http://gdata.youtube.com/schemas/2007#video.related" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/videos/XSGBVzeBUbk/related?v=2" />
    <link rel="http://gdata.youtube.com/schemas/2007#mobile" type="text/html" href="https://m.youtube.com/details?v=XSGBVzeBUbk" />
    <link rel="http://gdata.youtube.com/schemas/2007#uploader" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/users/pnWPofmXRLBFuteLDXta6w?v=2" />
    <link rel="self" type="application/atom+xml" href="https://gdata.youtube.com/feeds/api/videos/XSGBVzeBUbk?v=2" />
    <author>
        <name>Sophie Varney</name>
        <uri>https://gdata.youtube.com/feeds/api/users/sophiejvc</uri>
        <yt:userId>pnWPofmXRLBFuteLDXta6w</yt:userId>
    </author>
    <yt:accessControl action="comment" permission="allowed" />
    <yt:accessControl action="commentVote" permission="allowed" />
    <yt:accessControl action="videoRespond" permission="moderated" />
    <yt:accessControl action="rate" permission="allowed" />
    <yt:accessControl action="embed" permission="allowed" />
    <yt:accessControl action="list" permission="allowed" />
    <yt:accessControl action="autoPlay" permission="allowed" />
    <yt:accessControl action="syndicate" permission="allowed" />
    <gd:comments>
        <gd:feedLink rel="http://gdata.youtube.com/schemas/2007#comments" href="https://gdata.youtube.com/feeds/api/videos/XSGBVzeBUbk/comments?v=2" countHint="7222" />
    </gd:comments>
    <yt:hd />
    <media:group>
        <media:category label="Film &amp; Animation" scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Film</media:category>
        <media:content url="https://www.youtube.com/v/XSGBVzeBUbk?version=3&amp;f=videos&amp;app=youtube_gdata" type="application/x-shockwave-flash" medium="video" isDefault="true" expression="full" duration="597" yt:format="5" />
        <media:content url="rtsp://r6---sn-cg07lued.c.youtube.com/CiILENy73wIaGQm5UYE3V4EhXRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="597" yt:format="1" />
        <media:content url="rtsp://r6---sn-cg07lued.c.youtube.com/CiILENy73wIaGQm5UYE3V4EhXRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp" type="video/3gpp" medium="video" expression="full" duration="597" yt:format="6" />
        <media:credit role="uploader" scheme="urn:youtube" yt:display="Sophie Varney">sophiejvc</media:credit>
        <media:description type="plain">An animated short film about a Big Buck Bunny in HD

(c) copyright Blender Foundation | [ Register or Signin to view external links. ]
        <media:keywords />
        <media:license type="text/html" href="http://www.youtube.com/t/terms">youtube</media:license>
        <media:player url="https://www.youtube.com/watch?v=XSGBVzeBUbk&amp;feature=youtube_gdata_player" />
        <media:thumbnail url="http://i.ytimg.com/vi/XSGBVzeBUbk/default.jpg" height="90" width="120" time="00:04:58.500" yt:name="default" />
        <media:thumbnail url="http://i.ytimg.com/vi/XSGBVzeBUbk/mqdefault.jpg" height="180" width="320" yt:name="mqdefault" />
        <media:thumbnail url="http://i.ytimg.com/vi/XSGBVzeBUbk/hqdefault.jpg" height="360" width="480" yt:name="hqdefault" />
        <media:thumbnail url="http://i.ytimg.com/vi/XSGBVzeBUbk/1.jpg" height="90" width="120" time="00:02:29.250" yt:name="start" />
        <media:thumbnail url="http://i.ytimg.com/vi/XSGBVzeBUbk/2.jpg" height="90" width="120" time="00:04:58.500" yt:name="middle" />
        <media:thumbnail url="http://i.ytimg.com/vi/XSGBVzeBUbk/3.jpg" height="90" width="120" time="00:07:27.750" yt:name="end" />
        <media:title type="plain">Big Buck Bunny animation (1080p HD)</media:title>
        <yt:aspectRatio>widescreen</yt:aspectRatio>
        <yt:duration seconds="597" />
        <yt:uploaded>2009-09-11T16:28:28.000Z</yt:uploaded>
        <yt:uploaderId>UCpnWPofmXRLBFuteLDXta6w</yt:uploaderId>
        <yt:videoid>XSGBVzeBUbk</yt:videoid>
    </media:group>
    <gd:rating average="4.7951818" max="5" min="1" numRaters="26814" rel="http://schemas.google.com/g/2005#overall" />
    <yt:statistics favoriteCount="0" viewCount="11527406" />
    <yt:rating numDislikes="1373" numLikes="25441" />
</entry>


So now you have that you can extract the date when the video was published and current view count. Find out how many days have passed since it was published and then do viewCount/totalDays. It's only going to get you the mean average but it's an easy way to sample a video.

Another way would be to use the Insight part of the API which you can read up on here: [ Register or Signin to view external links. ]

I think that looks like it will return an XML or CSV between two given date/time which you can then get a lot more statistics from.
#7. Posted:
EMB
  • TTG Senior
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
I am not a coder. Anyone think that they could help me.
#8. Posted:
Bighair
  • Powerhouse
Status: Offline
Joined: Sep 26, 201013Year Member
Posts: 401
Reputation Power: 17
Status: Offline
Joined: Sep 26, 201013Year Member
Posts: 401
Reputation Power: 17
Have you got skype? i wanna know what you want done. I might be able to help..
#9. Posted:
EMB
  • TTG Senior
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Sorry to bump this, but if anyone can help with this can you add me on Skype: theycallmebrownie
#10. Posted:
EMB
  • TTG Senior
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Status: Offline
Joined: Mar 14, 201113Year Member
Posts: 1,354
Reputation Power: 61
Anyone willing to give me a hand?
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.