forked from publify/publify
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds in reply to context to Twitter posted messages
I know this really lacks test, and I don't really know how to fake the calls to the Twitter API. Any help appreviated.
- Loading branch information
Frédéric de Villamil
committed
Aug 16, 2013
1 parent
236e617
commit 31aa708
Showing
9 changed files
with
93 additions
and
18 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
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,13 @@ | ||
module StatusesHelper | ||
def get_reply_context_url(reply) | ||
begin | ||
return reply['user']['entities']['url']['urls'][0]['expanded_url'] | ||
rescue | ||
return "https://twitter.com/#{reply['user']['name']}" | ||
end | ||
end | ||
|
||
def get_reply_context_twitter_link(reply) | ||
link_to(display_date_and_time(reply['created_at'].to_time), "https://twitter.com/#{reply['user']['screen_name']}/status/#{reply['id_str']}") | ||
end | ||
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
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,10 @@ | ||
<article class=''> | ||
<%= image_tag(@reply['user']['profile_image_url'] , class: "alignleft", alt: @reply['user']['name']) %> | ||
<strong><%= link_to(@reply['user']['name'], get_reply_context_url(@reply)) %></strong> | ||
<p><%= PublifyApp::Textfilter::Twitterfilter.filtertext(nil,nil,@reply['text'],nil).nofollowify %></p> | ||
<p> | ||
<small> | ||
<%= get_reply_context_twitter_link(@reply) %> | ||
</small> | ||
</p> | ||
</article> |
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