cascaad 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 2010 Giordano Scalzo
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
@@ -0,0 +1,32 @@
1
+ = Cascaad
2
+ http://github.com/gscalzo/Cascaad
3
+
4
+ == Description
5
+ The ruby cascaad gem.
6
+ Just a simple wrapper to Cascaad SuperTweetApi.
7
+
8
+ Implemented "Show SuperTweet Api" and "Related SuperTweets Api" api.
9
+ "Conversation Api" still to implement.
10
+
11
+ == Examples
12
+
13
+ require "cascaad"
14
+
15
+ client = Cascaad::Client.new "DEV_API_KEY"
16
+
17
+ supertweets = client.show_messages("11845310763","11845134434","11843458299").from("twitter.com")
18
+
19
+ related_supertweets = client.related_messages("11845310763").from("twitter.com")
20
+ == Docs
21
+
22
+ Cascaad SuperTweet Api documentation.
23
+ http://cascaad.mashery.com/docs
24
+
25
+ == Install:
26
+
27
+ * sudo gem install cascaad
28
+
29
+ == Copyright
30
+
31
+ Copyright (c) 2010 Giordano Scalzo. See LICENSE for details.
32
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'rubygems/gem_runner'
3
+ require 'spec/rake/spectask'
4
+
5
+ desc "Run all specs"
6
+ Spec::Rake::SpecTask.new(:default) do |t|
7
+ t.spec_files = FileList['spec/**/*_spec.rb']
8
+ t.spec_opts = ['--options', 'spec/spec.opts']
9
+ end
10
+
@@ -0,0 +1,61 @@
1
+ require "open-uri"
2
+ require "json"
3
+
4
+ class Array
5
+ def valid_ids_required
6
+ raise Cascaad::BadRequest if(self.empty?)
7
+ self.each do |id|
8
+ raise Cascaad::BadRequest unless id =~ /[0-9]+/
9
+ end
10
+ end
11
+ end
12
+
13
+ module Cascaad
14
+ class BadApiKey < RuntimeError; end
15
+ class BadRequest < RuntimeError; end
16
+ class UnsupportedDomain < RuntimeError; end
17
+
18
+ class Client
19
+ BASE_URL='http://openapi.cascaad.com/1/supertweet'
20
+
21
+ attr :api_key
22
+
23
+ def initialize(api_key)
24
+ @api_key = api_key
25
+ end
26
+
27
+ def show_messages(*ids)
28
+ ids.valid_ids_required
29
+ Client.new(@api_key, "show", ids)
30
+ end
31
+
32
+ def related_messages(*ids)
33
+ ids.valid_ids_required
34
+ Client.new(@api_key, "related", ids)
35
+ end
36
+
37
+ def from(domain)
38
+ raise BadRequest if @command.empty?
39
+ raise UnsupportedDomain unless domain == 'twitter.com'
40
+
41
+ begin
42
+ open(api_url_for(domain)) do |response|
43
+ JSON.parse(response.read)
44
+ end
45
+ rescue OpenURI::HTTPError
46
+ raise Cascaad::BadApiKey
47
+ end
48
+ end
49
+
50
+ private
51
+ def initialize(api_key, command="", *ids)
52
+ @api_key = api_key
53
+ @command = command
54
+ @ids = ids
55
+ end
56
+
57
+ def api_url_for(domain)
58
+ "#{BASE_URL}/#{@command}.json?api_key=#{api_key}&domain=#{domain}&message=#{@ids.join(',')}"
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,92 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
2
+
3
+ require "spec_helper"
4
+ require "rubygems"
5
+ require "fakeweb"
6
+ require "cascaad"
7
+
8
+ FakeWeb.allow_net_connect = false
9
+
10
+ describe "A Cascaad client" do
11
+ it "should be created with APIKEY" do
12
+ client = Cascaad::Client.new 'APIKEY'
13
+ client.api_key.should == 'APIKEY'
14
+ end
15
+
16
+ context "with a bad api_key" do
17
+ before(:all) do
18
+ @client = Cascaad::Client.new 'BAD_API_KEY'
19
+ end
20
+
21
+ it "should raise an exception calling show_messages" do
22
+ reg_bad_url('developer_inactive.html',
23
+ 'http://openapi.cascaad.com/1/supertweet/show.json?domain=twitter.com&message=11845310763,11845134434,11843458299&api_key=BAD_API_KEY')
24
+ lambda {
25
+ @client.show_messages("11845310763","11845134434","11843458299").from("twitter.com")
26
+ }.should raise_error(Cascaad::BadApiKey)
27
+ end
28
+ it "should raise an exception calling related_messages" do
29
+ reg_bad_url('developer_inactive.html',
30
+ 'http://openapi.cascaad.com/1/supertweet/related.json?domain=twitter.com&message=11843458299&api_key=BAD_API_KEY')
31
+ lambda {
32
+ @client.related_messages("11843458299").from("twitter.com")
33
+ }.should raise_error(Cascaad::BadApiKey)
34
+ end
35
+ end
36
+
37
+ context "with a good api_key" do
38
+ before(:all) do
39
+ @client = Cascaad::Client.new 'GOOD_API_KEY'
40
+ end
41
+
42
+ it "should show messages" do
43
+ reg_good_url('show_messages.json',
44
+ 'http://openapi.cascaad.com/1/supertweet/show.json?domain=twitter.com&message=11845310763,11845134434,11843458299&api_key=GOOD_API_KEY'
45
+ )
46
+ supertweets = @client.show_messages("11845310763","11845134434","11843458299").from("twitter.com")
47
+ supertweets.size.should == 3
48
+ supertweets.first["supertweet"]["author_id"].should == "816653"
49
+ end
50
+
51
+ it "should return related messages" do
52
+ reg_good_url('related_messages.json',
53
+ 'http://openapi.cascaad.com/1/supertweet/related.json?domain=twitter.com&message=9760573348&api_key=GOOD_API_KEY'
54
+ )
55
+
56
+ supertweets = @client.related_messages("9760573348").from("twitter.com")
57
+ supertweets.size.should == 3
58
+ supertweets.first["supertweet"]["author_id"].should == "51200175"
59
+ end
60
+
61
+ it "should raise an exception for un unsupported domain" do
62
+ lambda {
63
+ @client.show_messages("1").from("facebook.com")
64
+ }.should raise_error(Cascaad::UnsupportedDomain)
65
+ end
66
+
67
+ it "should raise an exception when from called before any api" do
68
+ lambda {
69
+ @client.from("twitter.com").show_messages("1")
70
+ }.should raise_error(Cascaad::BadRequest)
71
+ end
72
+
73
+ [:show_messages, :related_messages].each do |message|
74
+ it "should raise BadRequest when #{message} called with an empty list of ids" do
75
+ lambda {
76
+ @client.send(message).from("twitter.com")
77
+ }.should raise_error(Cascaad::BadRequest)
78
+ end
79
+ it "should raise BadRequest when #{message} called with nil" do
80
+ lambda {
81
+ @client.send(message, nil).from("twitter.com")
82
+ }.should raise_error(Cascaad::BadRequest)
83
+ end
84
+ it "should raise BadRequest when #{message} called with almost one invalid id" do
85
+ lambda {
86
+ @client.send(message,"123", "adc").from("twitter.com")
87
+ }.should raise_error(Cascaad::BadRequest)
88
+ end
89
+ end
90
+ end
91
+ end
92
+
@@ -0,0 +1 @@
1
+ <h1>403 Developer Inactive</h1>
@@ -0,0 +1 @@
1
+ [{"supertweet":{"tweet_text_body":"¿Alguien sabe si libros de Kindle pueden ser bajados al Ipad?","tweet_domain":"twitter.com","author_screen_name":"fernandopaulsen","tweet_id":"11907826946","context":{"social_rank":6.94838,"links":[],"entities":[{"summary":"Amazon Kindle is a software and hardware platform developed by Amazon.com subsidiary Lab126 for rendering and displaying e-books and other digital media. Three hardware devices, known as \"Kindle\", \"Kindle 2,\" and \"Kindle DX\" support this platform, as does an iPhone application called \"Kindle for iPhone\". The first device was released in the United States on November 19, 2007.\nThe Kindle hardware device uses an E Ink brand electronic paper display, and is able to download content over Amazon Whispernet using the Sprint EVDO in the USA or, for newer Kindle 2 devices, AT&T's network internationally. The Kindle hardware device can be used without a computer, and Whispernet is accessible without any fee. These devices also provide free access to the internet. Kindle devices sold prior to October 19, 2009 were sold only in the United States. On October 7, 2009, Amazon announced an international version of the Kindle 2 with a built-in 3G (HSDPA) and EDGE/GSM wireless modem for connectivity in over 100 countries, which went on sale October 19, 2009 worldwide.\nOn March 3, 2009, Amazon.com launched an application called Kindle for iPhone in the App Store for iPhone and iPod Touch owners to","guid":"9202a8c04000641f8000000006c0190d","in_text_span":[{"position":{"start":27,"offset":6}}],"affiliate":[{"product":{"category":"Electronics","price":"$259.00","description":null,"name":"Kindle Wireless Reading Device (6\" Display, Global Wireless, Latest Generation)","thumb_url":"http://ecx.images-amazon.com/images/I/41t7SWZ2vpL._SL75_.jpg","url":"http://www.amazon.com/Kindle-Wireless-Reading-Display-Generation/dp/B0015T963C%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0015T963C","creator":"Amazon"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"amazon kindle","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f8000000006c0190d?maxwidth=80&maxheight=80&mode=fillcrop"},{"summary":"The iPad is a tablet computer developed by Apple Inc.It features multi-touch interaction with print, video, photo, and audio multimedia, internet browsing, and runs most current iPhone OS apps.The device has an LED-backlit 9.7-inch (25 cm) multi-touch in-plane switching color display running at XGA resolution.Steve Jobs has intended for the iPad to redefine the textbook, newspaper, and television industries in much the same way the iPod reshaped the music business.","guid":"9202a8c04000641f80000000137d4aa4","in_text_span":[{"position":{"start":56,"offset":4}}],"affiliate":[{"product":{"category":"Electronics","price":"$19.99","description":null,"name":"Belkin F8N365tt Screen Overlay for iPad","thumb_url":"http://ecx.images-amazon.com/images/I/416ajCs9prL._SL75_.jpg","url":"http://www.amazon.com/Belkin-F8N365tt-Screen-Overlay-iPad/dp/B003CFB1AS%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB003CFB1AS","creator":"Belkin"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"ipad","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f80000000137d4aa4?maxwidth=80&maxheight=80&mode=fillcrop"}]},"created_at":1270856512000,"author_id":"51200175"}},{"supertweet":{"tweet_text_body":"Setting up an iPad for my mom's bday present. Thoughts on essential apps? Obvs NYT, Netflix, ABC, Kindle, NPR. What else?","tweet_domain":"twitter.com","author_screen_name":"reckless","tweet_id":"11901296431","context":{"social_rank":5.8292475,"links":[],"entities":[{"summary":"Amazon Kindle is a software and hardware platform developed by Amazon.com subsidiary Lab126 for rendering and displaying e-books and other digital media. Three hardware devices, known as \"Kindle\", \"Kindle 2,\" and \"Kindle DX\" support this platform, as does an iPhone application called \"Kindle for iPhone\". The first device was released in the United States on November 19, 2007.\nThe Kindle hardware device uses an E Ink brand electronic paper display, and is able to download content over Amazon Whispernet using the Sprint EVDO in the USA or, for newer Kindle 2 devices, AT&T's network internationally. The Kindle hardware device can be used without a computer, and Whispernet is accessible without any fee. These devices also provide free access to the internet. Kindle devices sold prior to October 19, 2009 were sold only in the United States. On October 7, 2009, Amazon announced an international version of the Kindle 2 with a built-in 3G (HSDPA) and EDGE/GSM wireless modem for connectivity in over 100 countries, which went on sale October 19, 2009 worldwide.\nOn March 3, 2009, Amazon.com launched an application called Kindle for iPhone in the App Store for iPhone and iPod Touch owners to","guid":"9202a8c04000641f8000000006c0190d","in_text_span":[{"position":{"start":98,"offset":6}}],"affiliate":[{"product":{"category":"Electronics","price":"$259.00","description":null,"name":"Kindle Wireless Reading Device (6\" Display, Global Wireless, Latest Generation)","thumb_url":"http://ecx.images-amazon.com/images/I/41t7SWZ2vpL._SL75_.jpg","url":"http://www.amazon.com/Kindle-Wireless-Reading-Display-Generation/dp/B0015T963C%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0015T963C","creator":"Amazon"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"amazon kindle","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f8000000006c0190d?maxwidth=80&maxheight=80&mode=fillcrop"},{"summary":"The iPad is a tablet computer developed by Apple Inc.It features multi-touch interaction with print, video, photo, and audio multimedia, internet browsing, and runs most current iPhone OS apps.The device has an LED-backlit 9.7-inch (25 cm) multi-touch in-plane switching color display running at XGA resolution.Steve Jobs has intended for the iPad to redefine the textbook, newspaper, and television industries in much the same way the iPod reshaped the music business.","guid":"9202a8c04000641f80000000137d4aa4","in_text_span":[{"position":{"start":14,"offset":4}}],"affiliate":[{"product":{"category":"Electronics","price":"$26.99","description":null,"name":"TrendyDigital WaterGuard Waterproof Case, Waterproof Cover for Apple iPad, Blue Border","thumb_url":"http://ecx.images-amazon.com/images/I/41jbESCthtL._SL75_.jpg","url":"http://www.amazon.com/TrendyDigital-WaterGuard-Waterproof-Cover-Border/dp/B00373LR68%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB00373LR68","creator":"TrendyDigital"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"ipad","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f80000000137d4aa4?maxwidth=80&maxheight=80&mode=fillcrop"},{"summary":"Netflix (NASDAQ: NFLX) is an online DVD and Blu-ray Disc rental service, offering flat rate rental-by-mail and online streaming to customers in the United States. Established in 1997 and headquartered in Los Gatos, California, it has amassed a collection of 100,000 titles and approximately 10 million subscribers. The company has more than 55 million discs and, on average, ships 1.9 million DVDs to customers each day. Netflix previously claimed to spend about $300 million a year on postage. On February 25, 2007, Netflix announced the billionth DVD delivery. Two years later, on April 2, 2009, the company announced that it had mailed its two billionth DVD, and awarded the recipient with a complimentary lifetime membership. It topped the ForeSee Results’ Top 100 Online Retail Satisfaction Index with an American Customer Satisfaction Index score of 86, well over the industry average of 75.\nThe company provides a monthly flat-fee service for the rental of DVD and Blu-ray movies. A subscriber creates an ordered list, called a rental queue, of movies to rent. The movies are delivered individually via the United States Postal Service from an array of regional warehouses. Currently, there","guid":"9202a8c04000641f800000000013ddbf","in_text_span":[{"position":{"start":84,"offset":7}}],"affiliate":[{"product":{"category":"Books","price":"","description":null,"name":"Fast Company March 2010 Mark Zuckerberg/Facebook on Cover, Hulu vs Netflix, Cisco vs GE, HP vs IBM, How Amazon Apple & Google Stack Up, 50 Most Innovative Companies","thumb_url":"http://ecx.images-amazon.com/images/I/515W%2Bbd-sLL._SL75_.jpg","url":"http://www.amazon.com/Company-Zuckerberg-Facebook-Innovative-Companies/dp/B003A7L86K%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB003A7L86K","creator":""},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"netflix","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f800000000013ddbf?maxwidth=80&maxheight=80&mode=fillcrop"}]},"created_at":1270847268000,"author_id":"3496641"}},{"supertweet":{"tweet_text_body":"App de Kindle funciona perfecto en Ipad. Libros se leen bien, se puede controlar luminosidad y se pueden destacar párrafos en color.","tweet_domain":"twitter.com","author_screen_name":"fernandopaulsen","tweet_id":"11920950991","context":{"social_rank":5.69838,"links":[],"entities":[{"summary":"Amazon Kindle is a software and hardware platform developed by Amazon.com subsidiary Lab126 for rendering and displaying e-books and other digital media. Three hardware devices, known as \"Kindle\", \"Kindle 2,\" and \"Kindle DX\" support this platform, as does an iPhone application called \"Kindle for iPhone\". The first device was released in the United States on November 19, 2007.\nThe Kindle hardware device uses an E Ink brand electronic paper display, and is able to download content over Amazon Whispernet using the Sprint EVDO in the USA or, for newer Kindle 2 devices, AT&T's network internationally. The Kindle hardware device can be used without a computer, and Whispernet is accessible without any fee. These devices also provide free access to the internet. Kindle devices sold prior to October 19, 2009 were sold only in the United States. On October 7, 2009, Amazon announced an international version of the Kindle 2 with a built-in 3G (HSDPA) and EDGE/GSM wireless modem for connectivity in over 100 countries, which went on sale October 19, 2009 worldwide.\nOn March 3, 2009, Amazon.com launched an application called Kindle for iPhone in the App Store for iPhone and iPod Touch owners to","guid":"9202a8c04000641f8000000006c0190d","in_text_span":[{"position":{"start":7,"offset":6}}],"affiliate":[{"product":{"category":"Electronics","price":"$259.00","description":null,"name":"Kindle Wireless Reading Device (6\" Display, Global Wireless, Latest Generation)","thumb_url":"http://ecx.images-amazon.com/images/I/41t7SWZ2vpL._SL75_.jpg","url":"http://www.amazon.com/Kindle-Wireless-Reading-Display-Generation/dp/B0015T963C%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB0015T963C","creator":"Amazon"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"amazon kindle","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f8000000006c0190d?maxwidth=80&maxheight=80&mode=fillcrop"},{"summary":"The iPad is a tablet computer developed by Apple Inc.It features multi-touch interaction with print, video, photo, and audio multimedia, internet browsing, and runs most current iPhone OS apps.The device has an LED-backlit 9.7-inch (25 cm) multi-touch in-plane switching color display running at XGA resolution.Steve Jobs has intended for the iPad to redefine the textbook, newspaper, and television industries in much the same way the iPod reshaped the music business.","guid":"9202a8c04000641f80000000137d4aa4","in_text_span":[{"position":{"start":35,"offset":4}}],"affiliate":[{"product":{"category":"Electronics","price":"$19.99","description":null,"name":"Belkin F8N365tt Screen Overlay for iPad","thumb_url":"http://ecx.images-amazon.com/images/I/416ajCs9prL._SL75_.jpg","url":"http://www.amazon.com/Belkin-F8N365tt-Screen-Overlay-iPad/dp/B003CFB1AS%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB003CFB1AS","creator":"Belkin"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"ipad","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f80000000137d4aa4?maxwidth=80&maxheight=80&mode=fillcrop"}]},"created_at":1270874253000,"author_id":"51200175"}}]
@@ -0,0 +1 @@
1
+ [{"supertweet":{"tweet_text_body":"Twitter: 60 Percent Of Registered Accounts Are From Outside The U.S. - http://tcrn.ch/dygBTp by @leenarao","tweet_domain":"twitter.com","author_screen_name":"TechCrunch","tweet_id":"11845310763","context":{"social_rank":14.36327,"links":[{"in_text_span":{"position":{"start":71,"offset":21}},"snippet":{"summary":"Twitter's lead engineer for its International team, Matt Sanford, just posted an announcement detailing the microblogging network's global growth. According to Sanford, over 60% of registered Twitter accounts come from outside the US. The growth in accounts internationally isn't surprising, considering that we've seen Twitter's worldwide unique visits rise as U.S. traffic plateaus.\r\n\r\nTwitter also said that following the availability of its site in Spanish in November, the site saw a 50 percent boost in sign-ups from Spanish speaking countries. It seems that current events and political engagement seem to also precipitate growth for Twitter. Following the earthquake in Chile, signups spiked 1200% and nearly all of those were using Spanish as their language. In Colombia, signups are up 300% after politicians started using the network as a platform to speak to constituents.","title":"Twitter: 60 Percent Of Registered Accounts Are From Outside The U.S.","thumb_big_url":"http://cascaad-images.s3.amazonaws.com/10408_457d1a4da47b33e0668986c2622d33e4d5a242e1_bigger.jpeg","thumb_small_url":"http://cascaad-images.s3.amazonaws.com/10408_457d1a4da47b33e0668986c2622d33e4d5a242e1_small.jpeg"},"in_text_url":"http://tcrn.ch/dygBTp","type":"undefined","expanded_in_text_url":"http://techcrunch.com/2010/04/08/twitter-60-percent-of-registered-accounts-are-from-outside-the-u-s/"}],"entities":[{"summary":"Twitter is a free social networking and micro-blogging service that enables its users to send and read messages known as tweets. Tweets are text-based posts of up to 140 characters displayed on the author's profile page and delivered to the author's subscribers who are known as followers. Senders can restrict delivery to those in their circle of friends or, by default, allow open access. Users can send and receive tweets via the Twitter website, Short Message Service (SMS) or external applications. While the service itself costs nothing to use, accessing it through SMS may incur phone service provider fees.\nThe 140-character limit on message length was initially set for compatibility with SMS messaging, and has brought to the web the kind of shorthand notation and slang commonly used in SMS messages. The 140 character limit has also spurred the usage of URL shortening services such as tinyurl, bit.ly and tr.im, and content hosting services, such as Twitpic and NotePub to accommodate multimedia content and text longer than 140 characters.\nSince its creation in 2006 by Jack Dorsey, Twitter has gained notability and popularity worldwide. It is sometimes described as the \"SMS of the","guid":"9202a8c04000641f800000000484d119","in_text_span":[{"position":{"start":0,"offset":7}}],"affiliate":[{"product":{"category":"Books","price":"$24.95","description":null,"name":"Twitter Power: How to Dominate Your Market One Tweet at a Time","thumb_url":"http://ecx.images-amazon.com/images/I/415%2B45JgzIL._SL75_.jpg","url":"http://www.amazon.com/Twitter-Power-Dominate-Market-Tweet/dp/0470458429%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0470458429","creator":"Joel Comm"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"twitter","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f800000000484d119?maxwidth=80&maxheight=80&mode=fillcrop"}]},"created_at":1270763580000,"author_id":"816653"}},{"supertweet":{"tweet_text_body":"Marc Benioff's Secret Sales Weapon: Chatter On The iPhone (Video) - http://tcrn.ch/9vW7hu by @erickschonfeld","tweet_domain":"twitter.com","author_screen_name":"TechCrunch","tweet_id":"11845134434","context":{"social_rank":9.36327,"links":[{"in_text_span":{"position":{"start":68,"offset":21}},"snippet":{"summary":"As you'd expect, Salesforce CEO Marc Benioff is a constant salesman. At a dinner last night in New York City, he kept showing everybody in the room his newest baby, Salesforce Chatter, which turns Salesforce into feeds of people and customer data. He was showing it on his iPhone, which he wields as a sales weapon. (Benioff cornered one poor CIO with his iPhone demo for a good 20 minutes). \r\n\r\nI got Benioff to show me the iPhone app on video (after the jump). It is a supercharged, Chatterized version of Salesforce's iPhone app which is not yet generally available. But you can see how it is very Facebook-like in that you follow a stream of updates from people you work with. Each one has a profile. But companies and customers also have their own feeds and profiles. Anyone who uses a Twitter app on an iPhone or Facebook or Yammer will find this user-interface familiar.","title":"Marc Benioff’s Secret Sales Weapon: Chatter On The iPhone (Video)","thumb_big_url":"http://cascaad-images.s3.amazonaws.com/10408_78d8a75f70eff9079e46e622fab072d68c3f498d_bigger.jpeg","thumb_small_url":"http://cascaad-images.s3.amazonaws.com/10408_78d8a75f70eff9079e46e622fab072d68c3f498d_small.jpeg"},"in_text_url":"http://tcrn.ch/9vW7hu","type":"undefined","expanded_in_text_url":"http://techcrunch.com/2010/04/08/benioff-secret-sales-weapon-iphone-chatter/"}],"entities":[{"summary":"The iPhone is a line of an Internet and multimedia enabled smartphones designed and marketed by Apple Inc. The iPhone functions as a camera phone (also including text messaging and visual voicemail), a portable media player (equivalent to a video iPod), and an Internet client (with e-mail, web browsing, and Wi-Fi connectivity) — using the phone's multi-touch screen to provide a virtual keyboard in lieu of a physical keyboard.\nThe first-generation phone was quad-band GSM with EDGE; the second generation phone added UMTS with 3.6 Mbps HSDPA; the third generation adds support for 7.2 Mbps HSDPA downloading but remains limited to 384 Kbps uploading as Apple had not implemented the HSPA protocol.\nApple announced the iPhone on January 9, 2007, after months of rumors and speculation. The (retroactively labelled) original iPhone was introduced in the United States on June 29, 2007 before being marketed in Europe. Time magazine named it the Invention of the Year in 2007. Released July 11, 2008, the iPhone 3G supports faster 3G data speeds and assisted GPS. On March 17, 2009, Apple announced version 3.0 of the iPhone OS for the iPhone (and iPod Touch), released on June 17, 2009. The iPhone","guid":"9202a8c04000641f80000000047953d8","in_text_span":[{"position":{"start":51,"offset":6}}],"affiliate":[{"product":{"category":"Electronics","price":"$199.99","description":null,"name":"Apple iPod touch 8 GB (3rd Generation) NEWEST MODEL","thumb_url":"http://ecx.images-amazon.com/images/I/41WgyV%2ByOLL._SL75_.jpg","url":"http://www.amazon.com/Apple-touch-Generation-NEWEST-MODEL/dp/B002M3SOBU%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB002M3SOBU","creator":"Apple"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"iphone","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f80000000047953d8?maxwidth=80&maxheight=80&mode=fillcrop"},{"summary":"Marc Russell Benioff (born September 25, 1964, San Francisco, California) is Chairman & CEO of Salesforce.com, the leading enterprise Cloud Computing company.\nBenioff started salesforce.com in March 1999 in a rented San Francisco apartment and defined its mission as The End of Software. He is “credited with turning the software industry on its head” by using the Internet to “revamp the way software programs are designed and distributed.” He has long evangelized software-as-a-service as the model that would replace traditional enterprise software. He is the creator of the term “platform-as-a-service” and has extended salesforce.com’s reach by allowing customers to build their own applications on the company’s architecture, or in the salesforce.com “cloud”. He’s known for his willingness to take on very large competitors, frequently making outspoken remarks such as: \"Part of our mission is to end Microsoft.\" He is the author of three books, including the national best seller Behind the Cloud. \nBenioff has been recognized for pioneering innovation with honors such as the 2007 Ernst & Young Entrepreneur of the Year, the SDForum Visionary Award, and the Alumni Entrepreneur of the","guid":"9202a8c04000641f800000000460e945","in_text_span":[{"position":{"start":0,"offset":12}}],"affiliate":[{"product":{"category":"Books","price":"$9.95","description":null,"name":"The wisdom of Marc Benioff and Salesforce.com.(High Priority): An article from: Customer Interaction Solutions","thumb_url":"","url":"http://www.amazon.com/wisdom-Marc-Benioff-Salesforce-com-Priority/dp/B000PLX62S%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000PLX62S","creator":"Rich Tehrani"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"marc benioff","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f800000000460e945?maxwidth=80&maxheight=80&mode=fillcrop"}]},"created_at":1270763326000,"author_id":"816653"}},{"supertweet":{"tweet_text_body":"Jobs Takes A Few Pot Shots At Google, Rubs Salt Into The Wound With 'iAds' - http://tcrn.ch/9QM6Rp by @leenarao","tweet_domain":"twitter.com","author_screen_name":"TechCrunch","tweet_id":"11843458299","context":{"social_rank":25.332687,"links":[{"in_text_span":{"position":{"start":78,"offset":21}},"snippet":{"summary":"","title":"Jobs Takes A Few Pot Shots At Google, Rubs Salt Into The Wound With ‘iAds’","thumb_big_url":"http://cascaad-images.s3.amazonaws.com/10408_1e373c1684f91842b48bddb8e1f25b4c4bebb93b_bigger.jpeg","thumb_small_url":"http://cascaad-images.s3.amazonaws.com/10408_1e373c1684f91842b48bddb8e1f25b4c4bebb93b_small.jpeg"},"in_text_url":"http://tcrn.ch/9QM6Rp","type":"undefined","expanded_in_text_url":"http://techcrunch.com/2010/04/08/jobs-takes-a-few-pot-shots-at-google-rubs-salt-into-the-wound-with-iads/"}],"entities":[{"summary":"Google Inc. is an American public corporation specializing in Internet search. It also generates profits from advertising bought on its similarly free-to-user e-mail, online mapping, office productivity, social networking and video-sharing services. Advert-free versions are available via paid subscription. Google has more recently developed an open source web browser and a mobile phone operating system. Its headquarters, often referred to as the Googleplex, are in Mountain View, California. As of March 31, 2009 (2009 -03-31), the company had 19,786 full-time employees. It runs thousands of servers across the world, processing millions of search requests each day and about one petabyte of user-generated data each hour.\nGoogle was founded by Larry Page and Sergey Brin while students at Stanford University. It was first incorporated as a privately held company on September 4, 1998. The initial public offering was on August 19, 2004. It raised $1.67 billion, implying a total value of $23 billion. Google's rapid growth has sparked a sequence of new products, acquisitions and partnerships beyond its core search engine. Environmentalism, philanthropy and positive employee relations were","guid":"9202a8c04000641f800000000042acea","in_text_span":[{"position":{"start":30,"offset":6}}],"affiliate":[{"product":{"category":"Books","price":"$34.99","description":null,"name":"Google Analytics, 3rd Edition","thumb_url":"http://ecx.images-amazon.com/images/I/51SrPqY5rPL._SL75_.jpg","url":"http://www.amazon.com/Google-Analytics-3rd-Jerri-Ledford/dp/0470531282%3FSubscriptionId%3D09A353YT60QR9FJTHM82%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0470531282","creator":"Jerri L. Ledford"},"provider_url":"http://www.amazon.com","provider_name":"Amazon"}],"label":"google","image_url":"http://www.freebase.com/api/trans/image_thumb/guid/9202a8c04000641f800000000042acea?maxwidth=80&maxheight=80&mode=fillcrop"}]},"created_at":1270760895000,"author_id":"816653"}}]
@@ -0,0 +1,6 @@
1
+ --format
2
+ specdoc
3
+ --loadby
4
+ mtime
5
+ --reverse
6
+
@@ -0,0 +1,31 @@
1
+ module FakeWeb
2
+ def self.fixture_file(filename)
3
+ return "" if filename == ""
4
+ file_path = File.expand_path(File.dirname(__FILE__) + "/fixtures/" + filename)
5
+ File.read(file_path)
6
+ end
7
+
8
+ def self.register(params)
9
+ filename = params[:filename]
10
+ status = params[:status]
11
+ options = {:body => fixture_file(filename)}
12
+ options.merge!({:status => status}) unless status.nil?
13
+ url = params[:url]
14
+ FakeWeb.register_uri(:get, url, options)
15
+ end
16
+ end
17
+
18
+ def reg_bad_url(filename, url)
19
+ FakeWeb.register(
20
+ :filename => filename,
21
+ :status => ["403", "Forbidden"],
22
+ :url => url
23
+ )
24
+ end
25
+ def reg_good_url(filename, url)
26
+ FakeWeb.register(
27
+ :filename => filename,
28
+ :status => ["200", "Ok"],
29
+ :url => url
30
+ )
31
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cascaad
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Giordano Scalzo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-04-12 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: json
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.3
24
+ version:
25
+ description: "Simple wrapper to Cascaad SuperTweet api: http://cascaad.mashery.com/docs"
26
+ email: giordano@scalzo.biz
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.rdoc
33
+ files:
34
+ - lib/cascaad.rb
35
+ - LICENSE
36
+ - Rakefile
37
+ - README.rdoc
38
+ - spec/cascaad_spec.rb
39
+ - spec/fixtures/developer_inactive.html
40
+ - spec/fixtures/related_messages.json
41
+ - spec/fixtures/show_messages.json
42
+ - spec/spec.opts
43
+ - spec/spec_helper.rb
44
+ has_rdoc: true
45
+ homepage: http://github.com/gscalzo/Cascaad
46
+ licenses: []
47
+
48
+ post_install_message:
49
+ rdoc_options:
50
+ - --charset=UTF-8
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: "0"
64
+ version:
65
+ requirements: []
66
+
67
+ rubyforge_project:
68
+ rubygems_version: 1.3.5
69
+ signing_key:
70
+ specification_version: 3
71
+ summary: Wrapper to Cascaad SuperTweet Api.
72
+ test_files: []
73
+