How do we define space? What do spaces look like, and what do they sound like? The broad word 'space' evokes different interpretations and relations with other concepts. Thus we, Petra and Max, set out to display these interpretations through sound and image.
Hashtag Space gathers images from Instagram labelled with #space and popular related hashtags. All the images are grouped by their own hashtag and create a new planet in the Hashtag Space. The more popular a specific hashtag is, the larger the planet will grow. On its surface, everyone can see how people from all over the world view space and 'related' concepts (as defined by the people on Instagram) such as 'moon' and 'cats'.
The idea
We wanted to make a fully-automated program that was capable of refreshing itself every few minutes to show new pictures and a limited number of new related hashtags. This way, it was easy to see what people considered to be 'space' in a visual way that was always changing. Regarding the sound, we wanted to add similar functionality for Soundcloud but chose to keep this manual due to the large file sizes if we were to download a large number of tracks.
Program functionality
First, a maximum of sixteen images are taken from Instagram with a PHP script, using the websta.me RSS feed. The program then stitches these together like a mosaic. This part of the program was based on the ofxMosaic addon by Gene Kogan, which takes images from a folder and creates mosaics of a specific size. Each mosaic image is then used as a texture for spheres. These spheres hover around in space and look like small planets and are shown further below.
#space, all images taken from Instagram
The related tag #cat, all images taken from Instagram
Simultaneously, the PHP script checks the descriptions of the images tagged as #space for their other hashtags and counts the total number of times a hashtag appears. For all hashtags other than #space, this determines the size of the sphere. The more often a hashtag appears, the larger it is - but a hashtag has to appear at least two times to be counted as 'related'. A hashtag can be a small moon, or become a big planet of its own. The output of the PHP script is just a .txt file with a hashtag and number on each line.
space_p.php – contains the gathering of images from Instagram labeled #space, generates a file which contains the related hashtags and the number of times they occur. The images are saved in a folder.
hashtags_p.php – takes the file generated by space.php as input and for each hashtag in that file gathers images from Instagram labeled with that specific hashtag. The images are saved in a folder.
For the 3D spheres and the zooming in/out function, we based the code on the 3DPrimitivesExample in OpenFrameworks. We kept editing small bits of the code to see what every part did before editing it to our tastes and adding more spheres that all rotate. We also added text that showed what the current related hashtags were, and what music was playing. In the screenshot below, you can see the different spheres with different positions, images and sizes. #space is placed in the middle.
Playing with planets
You can do a few things with the planets and the music!
Press the right arrow key to explode the spheres.
Press the up arrow key to play a random song
Press the left arrow key to pause the sphere explosion
Press the down arrow key to reload the spheres
Click with the mouse to stop the spheres from spinning
Hashtag Space from Petra Kubernátová on Vimeo.
Issues
Unfortunately, while we were able to pull images from an Instagram RSS feed, we were not able to set the permissions of the created folders correctly. Our program in OpenFrameworks could not recognise or edit the photos that were automatically gathered. This turned out to be a very big issue and we spent a long time trying to fix it. On the day of the presentation, we opted for the following solution: after running the program, we looked at what hashtags were present, and set up the folders by hand for the pictures. We also looked over OpenFrameworks plugins that used the official API for Instagram, but since Instagram changed its API recently, these plugins were no longer functional.
Another issue was that there are a lot of bots that post spam on Instagram, including HD pictures of penes. We had to delete these manually before our presentation to keep it family friendly.
Song list
These songs were selected because they were tagged with #space on Soundcloud - apparently, this is the type of music or sound that people associate with space. Funnily enough, it includes the song used in the OpenFrameworks introduction class ;)
Used addons
ofxMosaic takes input images from a folder and creates a mosaic of a specified size that looks like a specified target picture. The Mosaic addon is based on other addons such as:
Downloads
The commented PHP and C++ code can be downloaded below. Alternatively, the C++ code can also be found on Pastebin - you can copy-paste this over the 3dPrimitivesExample.