-
1Step 1
Go to GitHub and check out the latest code into the directory of your choice onto your RPi:
sudo git clone https://github.com/atomkemp/nx2twitter.git
Make sure you have write privileges in the directory as you will be creating a config file and storing your Tweeted images within.
-
2Step 2
Open your gmail account and create a new folder titled NX2Twitter. This is where all of the recieved messages from your camera will be stored. It also prevents re-Tweeting the same Tweet.
-
3Step 3
Follow these directions to create a new Twitter Application and generate the necessary keys for Tweepy: http://www.dototot.com/how-to-write-a-twitter-bot-with-python-and-tweepy/
-
4Step 4
Follow these directions to install PIP and Tweepy onto your RPi: http://raspi.tv/tag/install-tweepy-on-raspberry-pi
If Tweepy does not want to install, try installing the v2.3 commit using:
sudo pip install git+https://github.com/tweepy/tweepy.git@a6f602bc95a6791de9c72f433a7ce3ddf2b63f16
-
5Step 5
Run the following to start the script:
sudo python nx2twitter.py
Follow the prompts to generate a config.n2t file. THIS FILE WILL CONTAIN SENSITIVE INFORMATION ABOUT YOUR GMAIL AND TWITTER ACCOUNT. Do this at your own risk and do NOT give anyone access to this file. THIS INFORMATION IS NOT ENCRYPTED.As configured, the NX2Twitter script will check your email twice a minute. Feel free to edit the code to alter this frequency, directories, add security, etc.
The script should automatically run the next time you start it as your information is read from the config file. If you want to generate a new one, either delete the config.n2t file or edit it directly.
-
6Step 6
Now set up your camera:
- Go to the 'wifi' setting on your camera and choose 'email.'
- Press menu and select 'Sender Setting.'
- Your name is your password. Choose a unique password and place it within semicolons (i.e. ;1234abcd;) The NX2Twitter script will parse this password from the email message and allow access to Tweepy. This also prevents jerks from tweeting to your account through your email.
- Use a valid email for sending. I tried something random and it didn't work.
- Your camera is now configured.
-
7Step 7
Shoot a photo, go to the wifi setting and select email. Select the sender that contains your password. (i.e. ;1234abcd;(youremail@email.com)) and set your Gmail as the receiver. Press 'Next' and select the photo your want to Tweet. Press 'Next'. Finally write out your Tweet and hit send. My camera has a pretty harsh character limit, so be consise.
-
8Step 8
Check your terminal and you should see the message parse and hopefully Tweet! Enjoy!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.