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
10 - def init(self, api):
12
13 @LastfmBase.cached_property
15 """shouts for this ssubject"""
16 from lastfm.shout import Shout
17 from lastfm.user import User
18 params = self._default_params({'method': '%s.getShouts' % self.__class__.__name__.lower()})
19 data = self._api._fetch_data(params).find('shouts')
20 return [
21 Shout(
22 body = s.findtext('body'),
23 author = User(self._api, name = s.findtext('author')),
24 date = s.findtext('date') and s.findtext('date').strip() and \
25 datetime(*(time.strptime(s.findtext('date').strip(), '%a, %d %b %Y %H:%M:%S')[0:6]))
26 )
27 for s in data.findall('shout')
28 ]
29
30 @LastfmBase.top_property("shouts")
32 """recent shout for this subject"""
33 pass
34
37
38 from datetime import datetime
39 import time
40