Guest User

Untitled

a guest
Jan 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. # You usually need to configure the Twitter::Client object before invoking REST API calls through the library
  2. # Note: if you are configuring Twitter4R to use in a Rails (v >= 2.3.x) application then add your configuration
  3. # overrides to a twitter4r.rb initializer under config/initializer directory (or equivalent if you override its
  4. # path in your web app).
  5. Twitter::Client.configure do |conf|
  6. # We can set Twitter4R to use <tt>:ssl</tt> or <tt>:http</tt> to connect to the Twitter API.
  7. # Defaults to <tt>:ssl</tt>
  8. conf.protocol = :ssl
  9.  
  10. # We can set Twitter4R to use another host name (perhaps for internal
  11. # testing purposes).
  12. # Defaults to 'twitter.com'
  13. conf.host = 'twitter.com'
  14.  
  15. # We can set Twitter4R to use another port (also for internal
  16. # testing purposes).
  17. # Defaults to 443
  18. conf.port = 443
  19.  
  20. # We can set proxy information for Twitter4R
  21. # By default all following values are set to <tt>nil</tt>.
  22. conf.proxy_host = 'myproxy.host'
  23. conf.proxy_port = 8080
  24. conf.proxy_user = 'myuser'
  25. conf.proxy_pass = 'mypass'
  26. # proxy protocol to use. Defaults to :http.
  27. conf.proxy_protocol = :http
  28.  
  29. # OAuth settings for your application and the Twitter REST API URIs
  30. conf.oauth_consumer_token = "<YOUR APP'S CONSUMER TOKEN HERE>"
  31. conf.oauth_consumer_secret = "<YOUR APP'S CONSUMER SECRETE HERE>"
  32.  
  33. # You shouldn't need to change the default URIs for the Twitter REST API unless Twitter changes them
  34. conf.oauth_request_token_path = "/oauth/request_token2"
  35. conf.oauth_access_token_path = "/oauth/access_token2"
  36. conf.oauth_authorize_path = "/oauth/authorize"
  37.  
  38. # path to prefix URIs of REST API calls. Defaults to "".
  39. conf.path_prefix = "/v1"
  40. # :http, :https or :ssl supported. :ssl is an alias for :https. Defaults to :ssl
  41. conf.search_protocol = :ssl
  42. # port to connect to for the Twitter Search service. Defaults to 443.
  43. conf.search_port = 443
  44. # path to prefix URIs of Search API calls. Defaults to "".
  45. conf.search_path_prefix = ""
  46.  
  47. # Set timeout in seconds for HTTP requests
  48. conf.timeout = 15
  49.  
  50. # Set OAuth consumer token and secret in configuration
  51. conf.oauth_consumer_token = "<the OAuth consumer token for your application>"
  52. conf.oauth_consumer_secret - "<the OAuth consumer secret for your application>"
  53. end
Add Comment
Please, Sign In to add comment