[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
hey /g/, i have this .json file (with tweets in it, duh) how
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 16
Thread images: 1
File: Stacie.png (335 KB, 500x450) Image search: [Google]
Stacie.png
335 KB, 500x450
hey /g/,

i have this .json file (with tweets in it, duh) how can i count how many tweets are in there ?

preferably some kind of python script would be nice

thank you
>>
>>52195883
who's that harlot?
>>
>>52195897
https://en.wikipedia.org/wiki/Emilie_Marie_Nereng
>>
I won't give you the code, but have a look at some features of the json markup for that content, what gets repeated when (and only when?) a tweet is listed? I'd imagine this would be piss easy with a spreadsheet application, but iterating through each line and checking for certain features would work too.
>>
>>52195883
Well its easy just use the Python library for json and usw the build in function. Vor gwark and awk
>>
>>52195883
> Baby's first regex
>>
>>52195906
import json
with open('data.json') as data_file:
data = json.load(data_file)
>>
https://stedolan.github.io/jq/manual/
>>
Gah so pretty
>>
>>52196037
dafuq is this
>>
bump 4 jesus
>>
>>52195941
>>52195963
These work but are far more effort than necessary
>>52195953
>>52195967
Only sane choice.
>>
>>52198558
i don't get it
>>
>>52196097
Nigga, you stupid? JQ is how you query/parse JSON. Learn it, faggot.
>>
>>52201597
isn't there a simple python script somewhere that could count the tweets in a json file ?
>>
>>52203221
you could find a feature that occurs once per tweet, like user id or something, save the JSON file as a text file and use the built in reader library to parse for that feature name line-by-line, just have a counter or something.
Thread replies: 16
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.