damonregan / tweetsforever Goto Github PK
View Code? Open in Web Editor NEWYour tweets that are related to your evernotes
Your tweets that are related to your evernotes
In notes.py...
authResult didn't seem to include noteStoreUrl
:
noteStoreHttpClient = THttpClient.THttpClient(authResult.noteStoreUrl)
AttributeError: 'AuthenticationResult' object has no attribute 'noteStoreUrl'
Based on the evernote API documentation, I constructed the noteStoreUrl:
noteStoreUrl = "https://sandbox.evernote.com/edam/note/" + user.shardId
noteStoreHttpClient = THttpClient.THttpClient(noteStoreUrl)
In tweets.py...
It appears that if a tweet text contains a unicode character (in this case, u'\u201c') a UnicodeEncodeError is generated.
Traceback (most recent call last):
File "tweets.py", line 25, in <module>
print status.text
File "c:\development\envs\tfe\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u201c' in position 12: character maps to <undefined>
In the notes.py...
The EDAMErrorCode
enum wasn't fetching the string value of the enum for the error code text:
errorText = Errors.EDAMErrorCode._VALUES_TO_NAMES[errorCode]
AttributeError: type object 'EDAMErrorCode' has no attribute '_VALUES_TO_NAMES'
I modified the EDAMErrorCode
class to include enum tostring and fromstring methods:
class EDAMErrorCode(object):
UNKNOWN = 1
BAD_DATA_FORMAT = 2
PERMISSION_DENIED = 3
INTERNAL_ERROR = 4
DATA_REQUIRED = 5
LIMIT_REACHED = 6
QUOTA_REACHED = 7
INVALID_AUTH = 8
AUTH_EXPIRED = 9
DATA_CONFLICT = 10
ENML_VALIDATION = 11
SHARD_UNAVAILABLE = 12
@classmethod
def tostring(cls, val):
for k,v in vars(cls).iteritems():
if v == val:
return k
@classmethod
def fromstring(cls, str):
return getattr(cls, str.upper(), None)
and then then modified the errorText statement to be:
errorText = Errors.EDAMErrorCode.tostring(errorCode)
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.