Help us understand the problem. What is going on with this article?

Twitterで指定のusernameのツイートを取得する

More than 3 years have passed since last update.

`gem install twitter'としてgemをインストール

twitter.rb
require "twitter"

client = Twitter::REST::Client.new do |config|
  config.consumer_key        = "CONSUMER_KEY" # ①
  config.consumer_secret     = "CONSUMER_SECRET" # ①
  config.access_token        = "ACCESS_TOKEN" # ①
  config.access_token_secret = "ACCESS_TOKEN_SECRET" # ①
end

client.user_timeline("②", { count:  } ).each do |timeline|
  tweet = client.status(timeline.id)
  puts tweet.created_at
  puts tweet.text
end

それぞれを説明すると、
① - Twitter Applicationを作り、取得した値を入れてください
② - 取得したいusername(@の後ろの箇所)を入れてください
③ - 取得したいツイートの数を入れてください

本当は、特定のハッシュタグのついた投稿を取得したかったのですが、なんかこっちが先に出来たので投稿

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away