[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7758":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":15,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":27,"discoverSource":28},7758,"twitter-ruby","sferik\u002Ftwitter-ruby","sferik","A Ruby interface to the Twitter API.","http:\u002F\u002Fwww.rubydoc.info\u002Fgems\u002Ftwitter",null,"Ruby",4577,1278,124,1,0,2,31.32,"MIT License",false,"master",true,[],"2026-06-12 02:01:44","# The Twitter Ruby Gem\n\n[![Lint](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Flint.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Flint.yml)\n[![Test](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Ftest.yml)\n[![Mutant](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Fmutant.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Fmutant.yml)\n[![Typecheck](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Ftypecheck.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Ftypecheck.yml)\n[![Yardstick](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Fyardstick.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsferik\u002Ftwitter-ruby\u002Factions\u002Fworkflows\u002Fyardstick.yml)\n[![Gem Version](https:\u002F\u002Fbadge.fury.io\u002Frb\u002Ftwitter.svg)][gem]\n\nThe Twitter Ruby Gem provides a Ruby interface to the X (Twitter) API v1.1.\n\nFor new projects, or if you need API v2 support, use the [X gem][x] as a more\nmodern alternative. It supports both API v1.1 and API v2.\n\n[x]: https:\u002F\u002Fsferik.github.io\u002Fx-ruby\u002F\n[gem]: https:\u002F\u002Frubygems.org\u002Fgems\u002Ftwitter\n\n## 💖 Sponsoring\nOpen source maintenance takes real time and effort. By sponsoring development,\nyou help us:\n\n1. 🛠  Maintain the library: Keeping it up-to-date and secure.\n2. 🌈 Add new features: Enhancements that make your life easier.\n3. 💬 Provide support: Faster responses to issues and feature requests.\n\n⭐️ Bonus: Sponsors will get priority support and influence over the project\nroadmap. We will also list your name or your company’s logo on our GitHub page.\n\nBuilding and maintaining an open-source project like this takes a considerable\namount of time and effort. Your sponsorship can help sustain this project. Even\na small monthly donation makes a huge difference!\n\nThanks for considering sponsorship. Together we can make the X gem even better!\n\n#### 🤑 [Sponsor today!][sponsor]\n\n[sponsor]: https:\u002F\u002Fgithub.com\u002Fsponsors\u002Fsferik\n\n## Announcements\nYou should [follow @gem][follow] on X for announcements and updates about\nthis library.\n\n[follow]: https:\u002F\u002Fx.com\u002Fgem\n\n## Configuration\nTwitter API v1.1 requests require OAuth credentials, so you'll need to\n[register an app in the X developer portal][register] first.\n\n[register]: https:\u002F\u002Fdeveloper.x.com\u002Fen\u002Fportal\u002Fdashboard\n\nAfter creating an app, you'll have a consumer key\u002Fsecret pair and an access\ntoken\u002Fsecret pair. Configure these before making requests.\n\nYou can pass configuration options as a block to `Twitter::REST::Client.new`.\n\n```ruby\nclient = Twitter::REST::Client.new do |config|\n  config.consumer_key        = \"YOUR_CONSUMER_KEY\"\n  config.consumer_secret     = \"YOUR_CONSUMER_SECRET\"\n  config.access_token        = \"YOUR_ACCESS_TOKEN\"\n  config.access_token_secret = \"YOUR_ACCESS_SECRET\"\nend\n```\n\n## Usage Examples\nAfter configuring a `client`, you can do the following things.\n\n**Tweet (as the authenticated user)**\n\n```ruby\nclient.update(\"I'm tweeting with @gem!\")\n```\n\n**Follow a user (by screen name or user ID)**\n\n```ruby\nclient.follow(\"gem\")\nclient.follow(213747670)\n```\n\n**Fetch a user (by screen name or user ID)**\n\n```ruby\nclient.user(\"gem\")\nclient.user(213747670)\n```\n\n**Fetch a cursored list of followers (by screen name, user ID, or the authenticated user)**\n\n```ruby\nclient.followers(\"gem\")\nclient.followers(213747670)\nclient.followers\n```\n\n**Fetch a cursored list of friends (by screen name, user ID, or the authenticated user)**\n\n```ruby\nclient.friends(\"gem\")\nclient.friends(213747670)\nclient.friends\n```\n\n**Fetch the timeline of Tweets by a user**\n\n```ruby\nclient.user_timeline(\"gem\")\nclient.user_timeline(213747670)\n```\n\n**Fetch the home timeline**\n\n```ruby\nclient.home_timeline\n```\n\n**Fetch the mentions timeline**\n\n```ruby\nclient.mentions_timeline\n```\n\n**Fetch a Tweet by ID**\n\n```ruby\nclient.status(27558893223)\n```\n\n**Search recent matching Tweets**\n\n```ruby\nclient.search(\"to:justinbieber marry me\", result_type: \"recent\").take(3).map do |tweet|\n  \"#{tweet.user.screen_name}: #{tweet.text}\"\nend\n```\n\n**Find a Japanese-language Tweet tagged #ruby (excluding retweets)**\n\n```ruby\nclient.search(\"#ruby -rt\", lang: \"ja\").first.text\n```\n\nFor more usage examples, see the full [documentation][].\n\n[documentation]: https:\u002F\u002Frubydoc.info\u002Fgems\u002Ftwitter\n\n## Streaming\nThis gem includes streaming clients for legacy API v1.1 streaming endpoints.\nEndpoint availability and access requirements depend on your developer account.\n\n**Configuration works just like `Twitter::REST::Client`**\n\n```ruby\nclient = Twitter::Streaming::Client.new do |config|\n  config.consumer_key        = \"YOUR_CONSUMER_KEY\"\n  config.consumer_secret     = \"YOUR_CONSUMER_SECRET\"\n  config.access_token        = \"YOUR_ACCESS_TOKEN\"\n  config.access_token_secret = \"YOUR_ACCESS_SECRET\"\nend\n```\n\n**Stream a random sample of Tweets**\n\n```ruby\nclient.sample do |object|\n  puts object.text if object.is_a?(Twitter::Tweet)\nend\n```\n\n**Stream mentions of coffee or tea**\n\n```ruby\ntopics = [\"coffee\", \"tea\"]\nclient.filter(track: topics.join(\",\")) do |object|\n  puts object.text if object.is_a?(Twitter::Tweet)\nend\n```\n\n**Stream Tweets, events, and direct messages for the authenticated user**\n\n```ruby\nclient.user do |object|\n  case object\n  when Twitter::Tweet\n    puts \"It's a tweet!\"\n  when Twitter::DirectMessage\n    puts \"It's a direct message!\"\n  when Twitter::Streaming::StallWarning\n    warn \"Falling behind!\"\n  end\nend\n```\n\nAn `object` may be one of the following:\n* `Twitter::Tweet`\n* `Twitter::DirectMessage`\n* `Twitter::Streaming::DeletedTweet`\n* `Twitter::Streaming::Event`\n* `Twitter::Streaming::FriendList`\n* `Twitter::Streaming::StallWarning`\n\n## Copyright\nCopyright (c) 2006-2026 Erik Berlin, John Nunemaker, Wynn Netherland, Steve Richert, Steve Agalloco.\nSee [LICENSE][] for details.\n\n[license]: LICENSE.md\n","Twitter Ruby Gem 是一个用于访问 Twitter API 的 Ruby 接口。它支持通过 OAuth 认证来实现对 Twitter API v1.1 的调用，提供了包括发推、读取推文等多种功能，并且有完善的文档和测试流程以确保代码质量和安全性。该项目适用于需要在 Ruby 应用中集成 Twitter 功能的场景，如社交媒体分析工具或自动化营销系统等。此外，对于新项目或者需要 API v2 支持的情况，推荐使用 X gem 作为更现代的选择。","2026-06-11 03:14:14","top_language"]