Ejemplo n.º 1
0
 def __call__(self, user, prot, args, session):
     args = args.replace(">", "").replace("<", "")
     username, password=args.split(' ', 1)
     jid = user.jid
     scheduling.getTwitterAPI(username, password).verify_credentials().addCallback(
         self.__credsVerified, prot, jid, username, password).addErrback(
         self.__credsRefused, prot, jid)
Ejemplo n.º 2
0
 def __call__(self, user, prot, args):
     args = args.replace(">", "").replace("<", "")
     username, password=args.split(' ', 1)
     jid = user.jid
     scheduling.getTwitterAPI(username, password
                              ).direct_messages(lambda x: None).addCallback(
         self.__credsVerified, prot, jid, username, password, user).addErrback(
         self.__credsRefused, prot, jid)
Ejemplo n.º 3
0
 def _do_search(self, query, jid, prot):
     rv = search_collector.SearchCollector()
     scheduling.getTwitterAPI().search(query, rv.gotResult, {'rpp': '3'}
         ).addCallback(moodiness.moodiness.markSuccess
         ).addErrback(moodiness.moodiness.markFailure
         ).addCallback(self._success, jid, prot, query, rv
         ).addErrback(self._error, jid, prot
         ).addErrback(log.err)
Ejemplo n.º 4
0
 def __call__(self, user, prot, args):
     if user.has_credentials:
         jid = user.jid
         scheduling.getTwitterAPI(user.username, user.decoded_password).update(
             args, 'twitterspy'
             ).addCallback(self._posted, jid, user.username, prot
             ).addErrback(self._failed, jid, prot)
     else:
         prot.send_plain(user.jid, "You must twlogin before you can post.")
Ejemplo n.º 5
0
 def __call__(self, user, prot, args, session):
     args = args.lower()
     if args == 'on':
         scheduling.getTwitterAPI(user.username, user.decoded_password).friends(
             self._gotFriendStatus(user.jid, prot), params={'count': '1'})
     elif args == 'off':
         user.friend_timeline_id = None
         prot.send_plain(user.jid, ":) No longer watching your friends.")
     else:
         prot.send_plain(user.jid, "Watch must be 'on' or 'off'.")
Ejemplo n.º 6
0
 def __call__(self, user, prot, args):
     args = args.lower()
     if args == 'on':
         scheduling.getTwitterAPI(user.username, user.decoded_password).friends(
             self._gotFriendStatus(user, prot), params={'count': '1'})
     elif args == 'off':
         user.friend_timeline_id = None
         # Disable the privates search.
         scheduling.users.set_creds(user.jid, None, None)
         def worked(stuff):
             prot.send_plain(user.jid, ":) No longer watching your friends.")
         def notWorked(e):
             prot.send_plain(user.jid, ":( Problem stopping friend watches. Try again.")
         user.save().addCallback(worked).addErrback(notWorked)
     else:
         prot.send_plain(user.jid, "Watch must be 'on' or 'off'.")
Ejemplo n.º 7
0
 def __call__(self, user, prot, args):
     scheduling.getTwitterAPI(user.username, user.decoded_password).show_user(
         str(args)).addErrback(self._fail, prot, user.jid, args
         ).addCallback(self._gotUser, prot, user.jid)
Ejemplo n.º 8
0
 def __call__(self, user, prot, args):
     scheduling.getTwitterAPI(user.username, user.decoded_password).unblock(
         str(args)).addCallback(self._left, user.jid, prot, args
         ).addErrback(self._failed, user.jid, prot, args)
Ejemplo n.º 9
0
 def __call__(self, user, prot, args, session):
     scheduling.getTwitterAPI(user.username, user.decoded_password).follow(
         str(args)).addCallback(self._following, user.jid, prot, args
         ).addErrback(self._failed, user.jid, prot, args)