thepanacealab / smmt Goto Github PK
View Code? Open in Web Editor NEWSocial Media Mining Toolkit (SMMT) main repository
License: GNU General Public License v3.0
Social Media Mining Toolkit (SMMT) main repository
License: GNU General Public License v3.0
if an empty output file already exists, get_metadata.py throws an error due to:
SMMT/data_acquisition/get_metadata.py
Line 81 in c2a7c02
This exasperates Issue #12
Since a empty output file is written if no valid API token is added.
When i try to use get_metadata.py to hydrate tsv file, the result is empty. Why and what can i do to get the resuly? Grateful for your answer. Many thanks
currently getting 1808100 - 1808200
creating ziped master json file
creating minimized json master file
creating CSV version of minimized json master file
Traceback (most recent call last):
File "get_metadata.py", line 187, in <module>
main()
File "get_metadata.py", line 183, in main
f.writerow([data["favorite_count"], data["source"], data["text"].encode('utf-8'), data["in_reply_to_screen_name"], data["is_retweet"], data["created_at"], data["retweet_count"], data["id_str"].encode('utf-8')])
File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python37-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u039f' in position 16: character maps to <undefined>
Hello,
I was trying to use get_metadata.py to hydrate the CSV file. I got four output files but they are all empty. It seems that my Twitter API credentials are valid as shown in the screenshot below but the program stopped at the first 100 rows. Does anyone know the possible reason for this issue? Thanks in advance!
Change text to reflect actual meaning of tool functionality
If get_metadata.py gets interrupted during hydration, a incomplete json object may be written to the output file.
If you try to restart the script, this leads to a json decode error.
Proprosed fix:
Check if last line of the output file is invalid, and remove it.
Example:
https://stackoverflow.com/questions/6685378/using-python-to-remove-incomplete-line-from-the-end-of-a-json-formatted-log-file
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.