File: Search.md

package info (click to toggle)
ruby-twitter 7.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,840 kB
  • sloc: ruby: 10,919; makefile: 6
file content (15 lines) | stat: -rw-r--r-- 508 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Search

This example assumes you have a configured Twitter REST `client`. Instructions
on how to configure a client can be found in [examples/Configuration.md][cfg].

[cfg]: https://github.com/sferik/twitter/blob/master/examples/Configuration.md

Here's a simple example of how to search for tweets. This query will return the
three most recent marriage proposals to @justinbieber.

```ruby
client.search("to:justinbieber marry me", result_type: "recent").take(3).each do |tweet|
  puts tweet.text
end
```