Inspiration
I thought it would be an interesting idea to take tweets about a certain subject (e.g. tweets that included the phrase 'it's snowing', 'it's too hot', tweets from the Sahara desert etc) and display theme with a visual theme. My initial idea (which I admit that if I'd gone ahead with I probably would've been able to finish) was to make a website to do this, but after noticing some other people working on Minecraft mods, I wondered if I could do it in Minecraft instead, with tweets about snow being displayed in a snowy area of the map, tweets from deserts like the Sahara or the Mojave being displayed in desert areas, etc.
What it does
The project is, unfortunately, unfinished. I was successful, however, in extracting twitter data (which can include locational filters) and print them to a text file using a python script. My plan was to use this text file and import it into in-game books or signposts, however I could not find any helpful resources that were not completely outdated, and as a result I ran out of time before completing the project's hopeful ambitions.
How I built it
Since I had little to no experience with Python before today's Hackathon, I decided to try and write it at least partly using this modern and extraordinarily readable language. I was successful in extracting twitter data, as mentioned earlier, and so I learned an extremely useful skill in this language. I built a 'test mod' for Minecraft using online tutorials, using the Minecraft Forge modding plugin and Java, using the IDE 'Eclipse'. I had some experience with Java before today however I had not used it for anything like this purpose. A python code snippet:
public_tweets = api.home_timeline()
#user = api.get_user()
text_file = open("Output.txt", "w")
blank = " "
for tweet in public_tweets:
print(tweet.user.screen_name)
print(tweet.text)
print()
with open('Output.txt', 'w', encoding='utf-8') as f:
for tweet in public_tweets:
print('@'+tweet.user.screen_name, file=f)
print(tweet.text, file=f)
print(blank, file=f)
Challenges I ran into
My main struggle, and the one that ultimately lead to the project being in its incomplete state, was the lack of resources on transferring data from a text file into in-game items in Minecraft. The only in-game item editor plugins I could find during the day that would allow me to do what I planned to do were severely outdated (i.e. discontinued and/or not patched for new versions of Minecraft). I believe if I developed further experience in creating mods for Minecraft using Forge, I could go back to this project and complete it.
Accomplishments that I'm proud of
I am proud of my python script, and that I learned so much about developing in the language by opting for taking this risky step in using a completely new language. I am also glad I started developing mods for Minecraft, something I have thought about learning to do for a while. While the example mod I made was very basic, it could lay the framework for greater things.
What I learned
I learned:
- Python syntax
- How to use tweepy and the twitter API to fetch tweets and put them in a text file.
How to implement location and word filters in order to only fetch relevant tweets.
Basic mod development for Minecraft
Expanded on my knowledge of Java syntax and capabilities, of which previously I had very little
What's next for Mine-Twitter
After gaining more experience, I will go back to this project and implement the in-game twitter capabilities fully.
Log in or sign up for Devpost to join the conversation.