drdrang / archive-tweets Goto Github PK
View Code? Open in Web Editor NEWUpdate a local archive of your tweets.
Update a local archive of your tweets.
If, like me, you don't read the code, you don't realize that the "me" value must be changed in Parameters. Maybe it is a good idea tell that in the README.
Thank you.
The default datefmt = '%B %-d, %Y at %-I:%M %p'
don't work with a german localized dates. The month may contains a umlaut and then the line '\n'.join(lines).encode('utf8')
fails with a UnicodeDecodeError
.
What happened: The string with the date is automatically decoded with the default codec (ASCII) but does not correctly decode the ä. When it later tries to encode the ascii string to utf8 the error is thrown.
You find a discussion about this here: http://bugs.python.org/issue5398
Explicitly decoding the date like this ts.strftime(datefmt).decode('utf8')
solves this issue for me.
Ps: Is the minus in %-d and %-I on purpose and if yes, what's the effect of it? Don't know this syntax and also seems to not work on my machine.
This script is great! You might want to put an explicit open source license on it, so people are clear about what they can do with it -- http://choosealicense.com/ can help with that (or I'm happy to help if you want).
Thanks,
-K
I ran into:
File "archive-tweets.py", line 46, in <module>
ts.strftime(datefmt).decode('utf8'),
AttributeError: 'str' object has no attribute 'decode'
As an error when using Python 3. Changing line 44 to ts.strftime(datefmt),
and changing line 48 to f.write('\n'.join(lines))
fixed the issue.
I'm happy to submit this as a pull request if the project is put under an open source license (I like the MIT license but that's just my preference).
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.