I am working with twitterAPI collecting tweets for specific keywords. I have already collected all the tweets into a json file. The data looks something like this:
{
"0": "this is tweet 1",
"1": "this is tweet 2",
.
.
.
continued
}
Now I want to make a function that loads data from the tweets. So far, I have only been successful this much:
def read_file(jsonfile):
#reads from my file and saves it in a list called data
with open(filename, 'r') as fp:
#i am not sure what to add here to save it as a list
data = json.loads(content)
return data
I would be very thankful if anyone could help.
edit: i want my result to be a list named 'xyz'