tweetwall 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -23,7 +23,7 @@ The print_tweets method returns an HTML division of Tweets.
23
23
  Simply call the print_tweets method like so:
24
24
  Tweetwall.print_tweets("oceancucumber")
25
25
 
26
- Optionally, you can specify they number of tweets:
26
+ Optionally, you can specify the number of tweets:
27
27
  Tweetwall.print_tweets("oceancucumber", 10)
28
28
 
29
29
  ## Contributing
data/lib/tweetwall.rb CHANGED
@@ -17,18 +17,24 @@ module Tweetwall
17
17
 
18
18
  tweet_wall_html = tweet_wall_html + '<div id="tweet_wall">'
19
19
  twitter_feed.each do |tweet|
20
+ # Process the tweet
20
21
  tweet_html = tweet.text
21
22
 
22
- # if there's a hyperlink, make it clickable
23
23
  words = tweet_html.split(" ")
24
24
  words.each do |word|
25
+ # if there's a hyperlink, make it clickable
25
26
  if word.start_with?("http://") or word.start_with?("https://")
26
27
  tweet_html = tweet_html.gsub(word, '<a href="' + word + '" target="_blank">' + word + '</a>')
27
28
  end
29
+
30
+ # if someone has been mentioned, make that clickable
31
+ if word.start_with?("@")
32
+ tweet_html = tweet_html.gsub(word, '<a href="http://www.twitter.com/#!/' + word.gsub(/\W$/, "").gsub("@", "") + '" target="_blank">' + word + '</a>')
33
+ end
28
34
  end
29
35
 
30
36
  tweet_wall_html = tweet_wall_html + '<div class="tweet_line">'
31
- tweet_wall_html = tweet_wall_html + '<img src="' + twitter_image + '" alt="" class="tweet_image" /> '
37
+ tweet_wall_html = tweet_wall_html + '<a href="http://www.twitter.com/#!/' + twitter_user + '" target="_blank"><img src="' + twitter_image + '" alt="" class="tweet_image" /></a> '
32
38
  tweet_wall_html = tweet_wall_html + '<span class="tweet_text">' + tweet_html + '</span><br />'
33
39
  tweet_wall_html = tweet_wall_html + '</div>'
34
40
  end
@@ -1,3 +1,3 @@
1
1
  module Tweetwall
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tweetwall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: