-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94fb991
commit 6a1d62f
Showing
6 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
REDIS_URL=redis://localhost:6379/3 | ||
|
||
TWITTER_ACCESS_TOKEN= | ||
|
||
GOOGLE_API_KEY= | ||
|
||
VIMEO_ACCESS_TOKEN= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# https://dev.twitter.com/rest/reference/get/statuses/user_timeline | ||
|
||
class TwitterParty | ||
include HTTParty | ||
base_uri "https://api.twitter.com/1.1" | ||
headers Authorization: "Bearer #{ENV["TWITTER_ACCESS_TOKEN"]}" | ||
format :json | ||
end | ||
|
||
class TwitterError < PartyError; end | ||
|
||
error TwitterError do |e| | ||
status 503 | ||
"There was a problem talking to Twitter." | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom"> | ||
<id>twitter:<%= @user_id %></id> | ||
<title><%= @username %> on Twitter</title> | ||
<icon>https://abs.twimg.com/favicons/favicon.ico</icon> | ||
<link href="<%= request.original_url.esc %>" rel="self" /> | ||
<link href="https://twitter.com/<%= @username %>" rel="alternate" /> | ||
<updated><%= Time.parse(@data[0]["created_at"]) if @data[0] %></updated> | ||
<%- @data.each do |tweet| -%> | ||
|
||
<entry> | ||
<id>twitter:tweet:<%= tweet["id_str"] %><%= ":#{params[:cachebuster]}" if params[:cachebuster] %></id> | ||
<title><%= tweet["text"].to_line.esc %></title> | ||
<link href="https://twitter.com/<%= @username %>/status/<%= tweet["id_str"] %>" /> | ||
<updated><%= Time.parse(tweet["created_at"]) %></updated> | ||
<author><name><%= @username %></name></author> | ||
<content type="html"> | ||
<%= tweet["text"].esc %> | ||
</content> | ||
</entry> | ||
<%- end -%> | ||
</feed> |