use the Twitter and iTunes APIs
[ad_1]
assignment:Given any Twitter hashtag, use the Twitter and iTunes APIs to generate a playlist of music that should accompany that hashtag.
– Get the last 200 tweets from the hashtag.
– Define a class `Tweet` to represent one tweet, analogous to the `Post` class in the Facebook problem set.
/> – You should have a `__str__` method that represents information about the tweet clearly
– Your additional method should return a list of all the words in the tweet that are not “stopwords” (e.g. “and”, “the”, “is”, etc — super-common words like that are often called “stopwords” in computational linguistics). Be sure to remove punctuation when deciding what a word is.
– You may have other additional methods, if you like.
– Create a list of instances of class `Tweet`.
– Using those instances and their capabilities, find the most common word that is at least five letters long and is not a “stopword”, across all of the tweets.
– Search on that word in the iTunes Search API — for songs that come up when you search with that as a search keyword. Make sure you are caching your data in the cache file.
– Define a class `Song`.
– It should have a `__str__` method that represents information about the song clearly, including the length of the song.
– Create a list of instances of class `Song`.
– Sort the song instances you get back from the iTunes API by the songs’ length, longest to shortest.
– Create a CSV file with information about all of those songs:
– The song title
– The artist of the song
– The length of the song
– The album the song is on
– And any other column(s) of information
[Button id=”1″]
[ad_2]
Source link