Giter Club home page Giter Club logo

autoremover's Introduction

Auto Remover

TwitterAPIを使用して、フォローしている以下の2つの方法でフォローしているユーザを整理するCLIツール

  • 片思いのユーザをリムーブ(直近でフォローした30人は除外)
  • 直近3ヶ月内で一度もツイートしていないユーザをリムーブ

システム要件

以下の環境で動作確認済み

要素 バージョン
debian 8.6
ruby 2.2.2
gem 2.4.5
bundle 1.13.4

前提

TwitterAPIを利用するための以下の4種のパラメータを用意済みであること

  • API KEY
  • API SECRET
  • ACCESS KEY
  • ACCESS SECRET

インストール方法

GitHubからclone

$ git clone [email protected]:Sa2Knight/autoRemover.git

ライブラリをインストール

$ sudo bundle install --path vendor/bundle

ライブラリ内の一部ファイルを修正(最新のRestAPI仕様に対応していないため)

vendor/bundle/ruby/2.2.0/gems/twitter_oauth-0.4.94/lib/twitter_oauth

def unfriend(id)
  post("/friendships/destroy.json", :user_id => id)
  #post("/friendships/destroy/#{id}.json")
end

実行方法

下記のように、各種APIキーをJSONで記述した、secret.jsonを作成する

{
  "api_key": "hogehogehogehogehogehogehoge",
  "api_secret": "fugafugafugafugafugafugafuga",
  "access_token": "foofoofoofoofoofoofoofoofoofoofoo",
  "access_secret": "barbarbarbarbarbarbarbarbarbarbar",
}

以下のコマンドでスクリプトを実行

$ bundle exec ruby main.rb

以下のように、画面の指示に従って番号を入力するとスクリプトが実行される

$ bundle exec ruby main.rb
(1) 片思いユーザをリムーブする
(2) 3ヶ月以上ツイートしていないユーザをリムーブする
実行する機能を番号で選択してください: 1
【************* をリムーブしました】
【************ をリムーブしました】
【********* をリムーブしました】
【******** をリムーブしました】
【*********** をリムーブしました】
【************** をリムーブしました】
【************ をリムーブしました】
$

その他

本ツールをベースにした拡張ツール https://github.com/Sa2Knight/TwitterAssistant

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.