get_mentions() refactored to use _sessionget()
authorMarek Marecki <triviuss@gmail.com>
Fri, 29 Mar 2013 10:44:53 +0000 (11:44 +0100)
committerMarek Marecki <triviuss@gmail.com>
Fri, 29 Mar 2013 10:44:53 +0000 (11:44 +0100)
diaspy/client.py

index abdd1d986c4895199e73f607ec5ed1f4469f9ddf..1a53851d1c534696515f6d7290b2706878423cb8 100644 (file)
@@ -114,9 +114,7 @@ class Client:
         """This function returns the current user's attributes.
 
         :returns: dict -- json formatted user info.
-
         """
-        #r = self.session.get('{0}/bookmarklet'.format(self.pod))
         r = self._sessionget('bookmarklet')
         regex = re.compile(r'window.current_user_attributes = ({.*})')
         userdata = json.loads(regex.search(r.text).group(1))
@@ -152,7 +150,6 @@ class Client:
 
         :returns: list -- list of Post objects.
         """
-
         data = {'authenticity_token': self.get_token()}
         r = self._sessionget('stream.json')
 
@@ -181,11 +178,10 @@ class Client:
         posts the current user is being mentioned in.
 
         :returns: list -- list of Post objects
-
         """
-
         data = {'authenticity_token': self.get_token()}
-        r = self.session.get('/mentions.json'.format(self.pod))
+        #r = self.session.get('/mentions.json'.format(self.pod))
+        r = self._sessionget('mentions.json')
 
         if r.status_code != 200:
             raise Exception('wrong status code: {0}'.format(r.status_code))