noaa_buoy a very simple hobby example of using Python to automate taking data from public, open data set (NOAA National Buoy Data Center real time data) and use it to interact with social media accounts on Twitter.
Written in Python using some OS libraries:
- pandas
- TwitterAPI
- matplotlib
- clint
This project is in a very early stage and likely to see many changes.
0.1 (2020-04-20) - Basic functioning CLI for reading data and sending tweets
- Posting buoycam, messages, latest measurements, retweets
- Windspeed with plot of last 7 days
- has been 'live' for a while, still semi-automated, need a user to take actions
Requires Python 3 and pip installed.
- Clone repository
pip install pandas
pip install TwitterAPI
pip install clint
pip install matplotlib
- To run buoy_data.py it takes as a parameter the station id for the NDBC buoy. In my case I'm doing this for Station 44011 George's Bank buoy.:
python buoy_data.py 44011
This will not tweet anything just print data.
-
To run for social media posting on Twitter if you register your own Twitter app at developer.twitter.com
- Edit
twitter_creds.py
and put in your Twitter App - Run the
twitter_client.py
:
Post a message
python twitter_client.py post tweet -m "Hello World"
Post the latest buoy data measurements
python twitter_client.py post latest
Post the most recent buoycam image
python twitter_client.py post buoycam
- Edit