LoginSignup
12
13

More than 5 years have passed since last update.

PokemonGo-SlackBot を CentOS7 と Docker で試してみた

Last updated at Posted at 2016-07-26

ロードバランスすだちくんのブログ ポケモンGOで自分の近くにポケモンが出現したらSlackに通知する をみてて試してみたくなったので、最初は Azure で CentoS 7 ベースで作っていたけど、もっと気軽にやりたくて半年ぶりぐらいに docker でやってみたメモ

※ちなみに住んでるところはポケモンが出ないので終了です... orz

dockerfile

pokemon
FROM docker.io/centos:7
MAINTAINER miyamiya

# Packages
RUN yum install -y epel-release \
  && yum install -y which sudo git gcc \
  && yum install -y python-pip \
  && yum update  -y \
  && yum clean all \
  && pip install pip --upgrade \
  && ln -s /usr/lib64/libpython2.7.so.1.0 /usr/lib/libpython2.7.so \
  && useradd bot \
  && echo "%bot ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/bot \
  && mkdir -p /home/bot && cd /home/bot \
  && git clone https://github.com/rubenmak/PokemonGo-SlackBot.git \
  && cd PokemonGo-SlackBot \
  && pip install -r requirements.txt \
  && chown -R bot.bot /home/bot 

# Platform config
USER bot
WORKDIR /home/bot/PokemonGo-SlackBot

イメージ作成

docker build -t pokemap -f pokemap .

docker run

docker run -it -v /etc/localtime:/etc/localtime:ro -e "LANG=en_US.UTF-8" --name "pokemap" pokemap /bin/bash

いでよポケモン!

  • ポケモントレーナークラブのユーザー名/パスワード
    hoge/fuga

  • 新宿御苑の緯度経度
    35.6851633 139.7074763

  • Slack の Incoming Webhook の URL
    https://hooks.slack.com/services/xxx

example
/usr/bin/python ~/PokemonGo-SlackBot/pokeslack.py -u hoge -p fuga -l "35.6851633 139.7074763" -st 1 -r 150 -sw https://hooks.slack.com/services/xxx -L "ja"

参考

12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13