appdotnet / adnpy Goto Github PK
View Code? Open in Web Editor NEWADNpy aims to be an easy to use python library for interacting with the App.net API.
Home Page: http://developers.app.net/
License: MIT License
ADNpy aims to be an easy to use python library for interacting with the App.net API.
Home Page: http://developers.app.net/
License: MIT License
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
There are several api methods bound with content_type 'multipart/form-data' but this is never set on the headers dict passed to request: https://github.com/appdotnet/ADNpy/blob/master/adnpy/api.py#L137
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.