Friday, May 4, 2012

Re: [YouTube-API] Re: strange search result

Thanks Jeff, yes I've wrapped things up safely now. All the best buddy...

Will


On 3 May 2012, at 22:19, Jeffrey Posnick <jeffy@google.com> wrote:

> Hello Will,
>
> I'd assume that this is just a case of the search index having stale
> data, which happens from time to time and normally corrects itself
> automatically.
>
> I'd recommend coding defensively when accessing YouTube response
> elements.
>
> Cheers,
> -Jeff Posnick, YouTube API Team
> groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
> @YouTubeDev
>
>
> On Apr 30, 9:17 am, wg <reachw...@gmail.com> wrote:
>> I've got to the bottom of the technical issue although I think it's
>> important for us to get to the bottom of why some crucial data was
>> undefined - there was a single search result in the array of results that
>> for some reason had no yt$statistics object in the returned JSON data.
>> Perhaps I've been lucky in testing up to that point not to have encountered
>> this situation in previous searches. Its within this object that we can
>> read the viewCount property and something that we should be able to present
>> to the person performing the search.
>>
>> The specific video that caused the problem
>> washttp://www.youtube.com/watch?v=lh2MdEfGgI4. I can view it at
>> youtube.com and also in our app (once I stop trying to read
>> the yt$statistics object). One thing I've noticed at youtube.com is that it
>> has a viewCount of 0 in the search results but 30+ views are displayed when
>> playing the video. I can of course conditionally use the yt$statistics
>> object if it exists? However - is there a reason somebody could give for
>> there being no yt$statistics object? Here's the trace from firebug that
>> shows where to look for the yt$statistics object. Object 48 has it but
>> Object 49 not..
>>
>> 1. 48: Object
>> 1. author: Array[1]
>> 2. category: Array[22]
>> 3. content: Object
>> 4. gd$comments: Object
>> 5. gd$rating: Object
>> 6. id: Object
>> 7. link: Array[5]
>> 8. media$group: Object
>> 9. published: Object
>> 10. title: Object
>> 11. updated: Object
>> 12. yt$statistics: Object
>> 13. __proto__: Object
>> 2. 49: Object
>> 1. author: Array[1]
>> 2. category: Array[16]
>> 3. content: Object
>> 4. gd$comments: Object
>> 5. id: Object
>> 6. link: Array[5]
>> 7. media$group: Object
>> 8. published: Object
>> 9. title: Object
>> 10. updated: Object
>> 11. __proto__: Object
>>
>> Cheers
>>
>> Will
>>
>>
>>
>>
>>
>>
>>
>> On Thursday, April 26, 2012 9:10:16 PM UTC+1, Jeffrey Posnick wrote:
>>
>>> Hello,
>>
>>> I can't reproduce what you're seeing. I also don't know what you mean
>>> when you're talking about the viewCount property, as that's an
>>> attribute associated with an individual video, not a search results
>>> feed.
>>
>>> Could you provide an example of the specific response values that are
>>> causing problems?
>>
>>> Cheers,
>>> -Jeff Posnick, YouTube API Team
>>> groups.google.com/group/youtube-api-gdata | apiblog.youtube.com |
>>> @YouTubeDev
>>
>>> On Apr 26, 12:34 pm, wg <reachw...@gmail.com> wrote:
>>>> Looking deeper, there are results but the web app bombs out because it
>>>> tries to read the viewCount property which is suddenly undefined when
>>> the
>>>> search term is as described below. So to summarise what we found so
>>> far..
>>>> Search 'david camero rupert' returns a viewCount property but 'david
>>>> cameron rupert' returns viewCount of undefined. Would best practice to
>>> be
>>>> to surround all references to properties in conditional 'if !undefined'
>>> ?
>>>> surely not!?
>>
>>>> On Thursday, April 26, 2012 5:12:14 PM UTC+1, wg wrote:
>>
>>>>> This could be something to be ready for when our clients ask why some
>>>>> search terms don't work. We've been looking at this again - it really
>>> is
>>>>> making us very curious. The search term 'david cameron ruper' with no
>>> 't'
>>>>> on rupert returns results of yes guess what - the recent news - but
>>> when
>>>>> the result has a 't' added on the end no results are returned.
>>> Likewise,
>>>>> when the search term is 'david camero rupert' with no 'n' on cameron
>>> we get
>>>>> a couple of results but as soon as the name is completed no results.
>>> If
>>>>> anybody else can be bothered to try let us know if you have the same
>>>>> strange results in any other 3rd party youtube search situation.
>>> Perhaps
>>>>> there are other terms that for some reason will return no results for
>>>>> whatever reason. It would be good to know the reason as we might get
>>>>> questions from our clients!
>>
>>>>> On Thursday, April 26, 2012 1:55:38 PM UTC+1, wg wrote:
>>
>>>>>> This is a weird observation I just stumbled across.. if I search for
>>>>>> 'David Cameron' using the youtube search API I get results. If I
>>>>>> search for 'Rupert Murdoch' I also get results. However, if I do a
>>>>>> search for 'David Cameron Rupert Murdoch' it doesn't work. If I do a
>>>>>> search for 'David Cameron Nick Clegg' or David Cameron and anybody
>>>>>> else it does work. Why would a search associating Cameron and Murdoch
>>>>>> not work in the youtube API? It works on youtube.com... weird! Can
>>>>>> anybody think of a non conspiracy related technical reason?
>
> --
> You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
> To post to this group, send email to youtube-api-gdata@googlegroups.com.
> To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment