Giter Club home page Giter Club logo

adnpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adnpy's Issues

Trying to get only PMs

I am trying to get notifications related to PMs.

stream_def = {
    "filter" : "1996", 
    "object_types": [
        "message"
    ],
    "type": "long_poll",
    "key": "my_stream"
}

Here is the Listener

class MyStreamListener(StreamListener):

    def on_message(self, message, meta):
        if meta.is_deleted:
            return

        if "MYID" in meta.subscribed_user_ids:
            print "send notitication to me"
        else:    
            print "just ignore ", meta.subscribed_user_ids          

my_api = adnpy.API.build_api(access_token=app_access_token)
stream  = Stream(my_api, stream_def, MyStreamListener)

stream.start()

I get this error

Traceback (most recent call last):
  File "test.py", line 51, in <module>
    stream.start()
  File "/Library/Python/2.7/site-packages/adnpy/stream.py", line 244, in start
    self._run()
  File "/Library/Python/2.7/site-packages/adnpy/stream.py", line 218, in _run
    self._read_loop(resp)
  File "/Library/Python/2.7/site-packages/adnpy/stream.py", line 237, in _read_loop
    self._data(line)
  File "/Library/Python/2.7/site-packages/adnpy/stream.py", line 230, in _data
    if self.listener.on_data(data) is False:
  File "/Library/Python/2.7/site-packages/adnpy/stream.py", line 120, in on_data
    args = getattr(self, prepare_method, self.prepare_fallback)(data.get('data'))
  File "/Library/Python/2.7/site-packages/adnpy/stream.py", line 77, in prepare_channel
    Message.from_response_data(data, self.api),
  File "/Library/Python/2.7/site-packages/adnpy/models.py", line 278, in from_response_data
    message.created_at = parse(message.created_at)
  File "/Library/Python/2.7/site-packages/adnpy/models.py", line 64, in __getattr__
    raise AttributeError(name)
AttributeError: created_at

Crash on on_star

stream_def = {
    "filter_id" : "2011",
    "object_types": [
        "message", "star"
    ],
    "type": "long_poll",
    "key": "neater_stream"
}

Crash happens here

    def on_star(self, star, meta):
        print "star is ", star

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.