Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Getting value from namespace item
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tom  
View profile  
 More options Oct 14 2009, 10:52 am
From: Tom <mail.tomdevr...@gmail.com>
Date: Wed, 14 Oct 2009 07:52:32 -0700 (PDT)
Local: Wed, Oct 14 2009 10:52 am
Subject: [GData Python client] Getting value from namespace item
Hi there,

While working with the gdata YouTube API, I've come across a problem
when trying to get a value from a namespace item not containing any
text.

When I want to retrieve the text from a item, it's pretty easy:

          namespace item:
          <?xml version='1.0' encoding='UTF-8'?>
          <ns0:title type="text" xmlns:ns0="http://www.w3.org/2005/
Atom">Merry Christmas and a happy new year!!</ns0:title>

          >>> for entry in feed.entry:
          ...     print entry.title.text

or even the 'type' when requesting the entry.title.type

I'm wondering if it's possible to the info of the favoriteCount and
viewCount on a namespace like this:

          <?xml version='1.0' encoding='UTF-8'?>
          <ns0:statistics favoriteCount="40" viewCount="22544"
xmlns:ns0="http://gdata.youtube.com/schemas/2007" />

When trying to print, for example, a ' entry.statistics.viewCount', I
get the error that a 'Statistics' object had no attribute 'viewCount'.
Is there an easy way to retrieve this value?

I think it will be a bit bloated to start using regular expressions on
each statistic item to retrieve the information.

I hope someone can help me out.

Regards, Tom


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »