Skip to content

mortalglitch/Social-Art-Feed

Repository files navigation

Social-Art-Feed

The Social Art Feed is designed to pull targeted livestream information from twitter and build a webpage out of the images from those post. Example of Output: http://omegaraven.com/testing_grounds/hashtagsmile/hashtagsmile.htm

Requirements

Social-Art-Feed uses the following: Python 3.5.2 (may work with other versions but this is what I tested with) Tweepy (To get Tweepy check out https://github.com/tweepy/tweepy)

Description of Parts:

  • StreamController.py: Is the main portion of the application it utilizes Tweepy to gather information from twitter based on filter criteria. It then uses a second filter to remove anything that is unwanted from the data. With the data that remains it generates Output.txt. This portion also generates a backup of the text file for debugging information.
  • NoEncodeBuilder.py: Takes Output.txt and generates an html document from it then saves the html file under /site You can edit the type of page that is generated by modifying the message in this file. (Currently using this version due to some encoding problems. Future versions may revert back to just using Builder.py if I can work out the unicode issue.)
  • FtpPush.py: This is a very simple FtpPush script that will push the html file up to the choosen site of your choice.
  • filter.txt: This is the file where you put all the terms you do not want showing up on the page.
  • Config.txt: This file stores the twitter token information.

Setup

Tweepy Config Set-Up:

  • Sign into Twitter ( Twitter )
  • Go to https://apps.twitter.com/
  • Choose to create a new app
  • Authorize said application for your own account
  • Go to the applications Keys and Access Tokens Page and you will need to get you Access Token, Access Secret, Consumer Token, and Consumer Secret. (Please note keep these private as they can be used to control your Twitter acount)
  • Open the Config.txt file and plug in the information:
CONSUMER_KEY:your_consumer_key
CONSUMER_SECRET:your_consumer_secret
ACCESS_KEY:your_access_key
ACCESS_SECRET:your_access_secret

(Important when switching out the information in this file don't put in a space after the colon)

Application Configuration:

  • Defining Search terms for LiveStream
    • Open StreamController.py
    • Add desired search filters to look for in the data stream
    # Filter Data here
    stream.filter(track=['#happy', '#life', '#love'])

(Each term is closed in using ' and seperated with , so here you see by default we are looking for post containing #happy, #life, and #love)

  • Build the filter file which contains which terms to exclude.
    • Open filter.txt and add what you would like to filter out with each one on it's own line.
retweeted_status
#FOLLOWTRICK
bieber
quoted_status

(You can also put in the json parameters from Twitter like "possibly_sensitive":true to block many adult post. Some will get through if the user isn't using Twitter properly.)

Builder Configuration:

  • You can adjust the way the page looks from Builder.py (Leaving it will generate an example.htm file under the /site folder)
  • The name you use here will need to be the same name referenced in the FtpPush.py should you choose to use it.

Optional:

The scripts call themselves so you can modify this by editting the StreamController.py Remove the function calls inside the on_data function.

    Builder.build_func()
    FtpPush.push_data()

Usage:

I am currently operating from a Linux System and start the program by going into the folder from terminal and run

python3 StreamController.py

Notes:

If anyone does anything with this and would like to show me hit me up either here through github or mortal.glitch at omegaraven dot com. Licensed under the MIT License.

About

A set of python scripts that can gather target information from twitter and then use that data to build a webpage using the images from the twitter stream.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published