1
2
3 __author__ = "Abhinav Sarkar <abhinav@abhinavsarkar.net>"
4 __version__ = "0.2"
5 __license__ = "GNU Lesser General Public License"
6
7 from lastfm.base import LastfmBase
8 from lastfm.decorators import cached_property, top_property
11 - def init(self, api):
13
14 @cached_property
16 """shouts for this ssubject"""
17 from lastfm.shout import Shout
18 from lastfm.user import User
19 params = self._default_params({'method': '%s.getShouts' % self.__class__.__name__.lower()})
20 data = self._api._fetch_data(params).find('shouts')
21 return [
22 Shout(
23 body = s.findtext('body'),
24 author = User(self._api, name = s.findtext('author')),
25 date = s.findtext('date') and s.findtext('date').strip() and \
26 datetime(*(time.strptime(s.findtext('date').strip(), '%a, %d %b %Y %H:%M:%S')[0:6]))
27 )
28 for s in data.findall('shout')
29 ]
30
31 @top_property("shouts")
33 """recent shout for this subject"""
34 pass
35
38
39 from datetime import datetime
40 import time
41