Try Katsuhiro Morishita / Aso_Sea_Clouds_Pridiction Memo-Excluding the learning part-

Introduction

The machine learning device of @unkaitter, which tweeted the sea of clouds forecast in Aso, Kumamoto Prefecture, has been released, so I will try it myself. This is a memo (I am also a related person, but I developed something other than a machine learning device).

The goal is to get the source code and tweet tomorrow's sea of clouds forecast with the learned results.

There will be a Workshop to play with machine learning devices this weekend. As a preparation before that.

environment

IDCF cloud virtual machine

Python environment preparation

Anaconda download

https://www.continuum.io/downloads#_unix

image

root@m1:/tmp# wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.5.0-Linux-x86_64.sh

Anaconda installation

root@m1:/tmp# bash Anaconda3-2.5.0-Linux-x86_64.sh

Answer the following to complete the installation

OK if it is python3 with the characters of Anaconda

root@m1:/tmp# source ~/.bashrc
root@m1:/tmp# which python
/usr/local/anaconda3/bin/python
root@m1:/tmp# python -V
Python 3.5.1 :: Anaconda 2.5.0 (64-bit)

Get the Python library for OAuth authentication

root@m1:/tmp# pip install requests requests_oauthlib
root@m1:/tmp# pip list | grep requests-oauthlib
requests-oauthlib (0.6.0)

Get source code

I may fork it later, so I will fork it.

Fork on GitHub

Access below https://github.com/KatsuhiroMorishita/Aso_Sea_Clouds_Pridiction

Press the Fork button image

Copy URL image

Clone with Git

m1:~/work> git clone https://github.com/makoragi/Aso_Sea_Clouds_Pridiction.git

Finally tweet

Set Twitter credentials

Use this as a reference to get Twitter authentication information. [Create Twitter Application](http://website-planner.com/twitter%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3 % 82% B7% E3% 83% A7% E3% 83% B3% E3% 81% AE% E4% BD% 9C% E6% 88% 90% EF% BC% 88consumer-key% E3% 80% 81consumer-secret % E3% 80% 81access-token% E3% 80% 81access-token-secret /)

Prepare a 4-line text file that describes the keys, etc. (Please rewrite the << Hogehoge >> part)

m1:~/work/Aso_Sea_Clouds_Pridiction> cat ../tweet_key.txt
<<Consumer Key>>
<<Consumer Secret>>
<<Access Token>>
<<Accesss Token Secret>>

Edit the code to tweet

Edit twitter_bot.py as needed The original code is supposed to be executed at 16:00 and 23:00 as in the operation, but I wanted to execute it immediately, so I played with it a little.

m1:~/work/Aso_Sea_Clouds_Pridiction> vi twitter_bot.py

For details, see the following branch ea92900f739d63a2f131c6db303ee53b164e9043

Forecast & Tweet

m1:~/work/Aso_Sea_Clouds_Pridiction> python twitter_bot.py
:(abridgement)
【unkaitter bot test】2016-02-The likelihood of a sea of clouds appearing at 15 is 0.It is 3. 2016-02-14 22:37:21.797110
--tweet OK--
--done--

I did it (I couldn't read kanji like a dog) image

at the end

So I was able to tweet. Next, I want to execute the learning part as well.

Recommended Posts

Try Katsuhiro Morishita / Aso_Sea_Clouds_Pridiction Memo-Excluding the learning part-
Try deep learning with TensorFlow Part 2
Try installing only the core part of Ubuntu
Try the Pepper NAOqi OS 2.5.5 SLAM feature ~ Part 2
Try using the Python web framework Tornado Part 1
Try using the Python web framework Tornado Part 2
Report_Deep Learning (Part 1)
Report_Deep Learning (Part 1)
Report_Deep Learning (Part 2)
Try to visualize the room with Raspberry Pi, part 1