https://github.com/johncoleman83/bootcamp-mtb
🐦 python application [DEMO], for twitter automation with Cloud Foundry on IBM Bluemix
https://github.com/johncoleman83/bootcamp-mtb
bot cloud-foundry demo ibm-bluemix python twitter
Last synced: 7 months ago
JSON representation
🐦 python application [DEMO], for twitter automation with Cloud Foundry on IBM Bluemix
- Host: GitHub
- URL: https://github.com/johncoleman83/bootcamp-mtb
- Owner: johncoleman83
- License: mit
- Created: 2017-05-08T21:41:16.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T02:53:34.000Z (over 2 years ago)
- Last Synced: 2025-02-05T10:49:40.451Z (8 months ago)
- Topics: bot, cloud-foundry, demo, ibm-bluemix, python, twitter
- Language: Python
- Homepage: http://www.mtb.mybluemix.net
- Size: 71.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Support: support/aldict_unicode.py
Awesome Lists containing this project
README
# mini tweet bot
:a python application [DEMO], for twitter automation with Cloud Foundry on IBM Bluemix
### python
* __language:__ Python 3.6.1
* __libraries:__ tweepy, time, multiprocessing, opencv-python, numpy, workzeug
* __web framework:__ flask
* __style__: PEP 8: https://www.python.org/dev/peps/pep-0008/### cloud:
* __infrastructure:__ IBM Bluemix, https://www.ibm.com/cloud-computing/bluemix/
* __platform:__ Cloud Foundry, https://www.cloudfoundry.org/### examples:
* __working app:__ https://bootcamp-mtb.mybluemix.net/
* __original app:__ https://mtb.mybluemix.net/
* __blog:__ http://www.davidjohncoleman.com/2017/mini-tweet-bot/## description
Demo of how a company could customize mini tweet bot to use for their lobby, an
event, a promotion, or other public relations campaign. For the original tweet
bot, check out the link to the 'original' above. Note: This
demo is designed to function on an ipad tablet, and therefore does not format
properly on all devices.## documentation
For integration with IBM Bluemix, cloudfoundry apps, see the
[README.md](https://github.com/IBM-bluemix/get-started-python)
from the below referenced repository. Or read the blog post referenced above,
or check out the original mini tweet bot referenced above.## file list
* for complete file list see file: `./FILELIST.md`
## usage
* from local machine:
```
$ python3 app.py
```* with cloudfoundry CLI:
```
$ cf login -a api.[my-cloudfoundry].com
$ cd [my-app-directory]
$ cf push -b https://github.com/heroku/heroku-buildpack-python.git
```
Note: use latest heroku python buildpack for most updated python & pip
versions## build your own bot
* fork or clone the github repository.
* get your own twitter app from twitter dev tools linked above.
* change the `mycredentials.py` file name to `credentials.py`
* change the strings from the credentials file to contain your personal
twitter information.
* change the twitter feed link in the HTML tag to instead link to
your twitter feed.
* change the link of the twitter handle in the nav HTML tag to link instead
to your linked twitter account.
* change the icon/ logos to your preference
* find the cloud to host the app. Mini tweet bot is already setup with
Cloud Foundry for IBM Bluemix, but other cloud services will work as well.__NOTE:__ The mini tweet bot functions most successfully when hosted on a
cloud. However, if you would like to run the app on your own machine, you can
run it, and it will be loaded on a local host port IP address such as:
http://0.0.0.0:8080/. If you do not want the user interface, you should then
use only the tweet functions, and run them on an as needed basis. Here is an
example of how to run a single function from the `singletweet.py` file in the
`./support` directory:```
$ cat singletweet.py
import tweepy
from credentials import *auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)def tweet_text(tweetvar):
""" tweets text from input variable """
try:
api.update_status(tweetvar)
except:
print("error")
passtweet_text("this tweet is an example of running a tweet function in python")
$ python singletweet.py
```### Authors
* David John Coleman II, [davidjohncoleman.com](http://www.davidjohncoleman.com/)
* Carrie Ybay, [@hicarrie](https://github.com/hicarrie)### License
MIT License