Giter Club home page Giter Club logo

aws-sns-register's Introduction

AWS SNS Topicに携帯電話番号(SMS)を登録するサンプル

概要

  • CSVファイルを解析
  • 解析したデータの中から電話番号を抽出
  • その電話番号を該当のSNSトピックに登録する(boto3使用)

.env ファイルの用意

  • 機密情報はgithubリポジトリにはコミットしない
  • ローカルで自分しかわからないようにしておく
  • 事前に下記三つの情報を用意する
AWS_ACCESS_KEY_ID=xxxx
AWS_SECRET_ACCESS_KEY=xxxx
TOPIC_ARN=arn:aws:sns:xxxx

CSVの設置

data/telephone.csv を設置

フォーマット

  • 1行目は列名
  • 2列目に電話番号
例)

name,tel,created_at
tell-k,090xxxxxxxx,2018-02-01
tell-k,090xxxxxxxx,2018-02-01
tell-k,090xxxxxxxx,2018-02-01

セットアップ + 実行

$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
(venv) $ python main.py

メモ

  • SNSトピックに電話番号(SMS)を登録する時は、日本のであれば 「+81」が必要になる
    • 09012345678 -> +8109012345678
  • SNSトピックに対しては重複して電話番号を登録できない。
    • トピックと電話番号は 1対1の関係になる
    • = つまりプログラムで重複排除する必要なし

参考

aws-sns-register's People

Contributors

tell-k avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.