1

Sorry if the title is confusing. Basically what I am trying to do is create an excel sheet with data that is in a url that I have.

The url is a search API for twitter that retrieves the past 100 tweets with a given keyword of my choice. I am trying to to create an excel sheet that stores each tweet in it's own row. Essentially it will only be 1 column but will be 100 rows.

I have looked online but haven't really seen a way to do exactly what I need so if anyone knows a tutorial i should look at or could show me how to get started that would be great.

Thanks!

1 Answer 1

1

There will probably not be a tutorial on exactly how to do this. you need to put a couple different concepts together

  1. Get the data from the url. This can be as simple as urllib.urlopen
  2. Turn that data (string) into a usable format. Twitter will probably return json. Turn that into a python dict
  3. Open a file for writing
  4. Loop through twitter data and write to ouput file

You only need to create a .csv file. It will work great with excel. For one column file you just need to write the header then write each line of data. Python provides everything you need to create well formed csv files in the csv module in the standard library

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.