bitly 1.1.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +36 -3
  3. data/.rspec +3 -0
  4. data/.travis.yml +6 -2
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +5 -2
  7. data/History.txt +32 -1
  8. data/LICENSE.md +1 -1
  9. data/README.md +151 -58
  10. data/Rakefile +6 -9
  11. data/bitly.gemspec +36 -32
  12. data/config/env.yml.example +5 -0
  13. data/lib/bitly.rb +9 -7
  14. data/lib/bitly/api.rb +19 -0
  15. data/lib/bitly/api/base.rb +23 -0
  16. data/lib/bitly/api/bitlink.rb +342 -0
  17. data/lib/bitly/api/bitlink/clicks_summary.rb +35 -0
  18. data/lib/bitly/api/bitlink/deeplink.rb +29 -0
  19. data/lib/bitly/api/bitlink/link_click.rb +75 -0
  20. data/lib/bitly/api/bitlink/paginated_list.rb +52 -0
  21. data/lib/bitly/api/bsd.rb +24 -0
  22. data/lib/bitly/api/click_metric.rb +186 -0
  23. data/lib/bitly/api/client.rb +588 -0
  24. data/lib/bitly/api/group.rb +232 -0
  25. data/lib/bitly/api/group/preferences.rb +73 -0
  26. data/lib/bitly/api/list.rb +22 -0
  27. data/lib/bitly/api/oauth_app.rb +26 -0
  28. data/lib/bitly/api/organization.rb +104 -0
  29. data/lib/bitly/api/shorten_counts.rb +61 -0
  30. data/lib/bitly/api/user.rb +107 -0
  31. data/lib/bitly/error.rb +33 -0
  32. data/lib/bitly/http.rb +10 -0
  33. data/lib/bitly/http/adapters.rb +9 -0
  34. data/lib/bitly/http/adapters/net_http.rb +27 -0
  35. data/lib/bitly/http/client.rb +33 -0
  36. data/lib/bitly/http/request.rb +118 -0
  37. data/lib/bitly/http/response.rb +66 -0
  38. data/lib/bitly/oauth.rb +109 -0
  39. data/lib/bitly/version.rb +3 -1
  40. metadata +82 -111
  41. data/Manifest +0 -37
  42. data/lib/bitly/client.rb +0 -145
  43. data/lib/bitly/config.rb +0 -29
  44. data/lib/bitly/url.rb +0 -103
  45. data/lib/bitly/utils.rb +0 -57
  46. data/lib/bitly/v3.rb +0 -14
  47. data/lib/bitly/v3/bitly.rb +0 -7
  48. data/lib/bitly/v3/client.rb +0 -207
  49. data/lib/bitly/v3/country.rb +0 -13
  50. data/lib/bitly/v3/day.rb +0 -13
  51. data/lib/bitly/v3/missing_url.rb +0 -15
  52. data/lib/bitly/v3/oauth.rb +0 -41
  53. data/lib/bitly/v3/realtime_link.rb +0 -18
  54. data/lib/bitly/v3/referrer.rb +0 -13
  55. data/lib/bitly/v3/url.rb +0 -154
  56. data/lib/bitly/v3/user.rb +0 -135
  57. data/test/bitly/test_client.rb +0 -266
  58. data/test/bitly/test_config.rb +0 -28
  59. data/test/bitly/test_url.rb +0 -167
  60. data/test/bitly/test_utils.rb +0 -79
  61. data/test/fixtures/cnn.json +0 -1
  62. data/test/fixtures/cnn_and_google.json +0 -1
  63. data/test/fixtures/expand_cnn.json +0 -1
  64. data/test/fixtures/expand_cnn_and_google.json +0 -1
  65. data/test/fixtures/google_and_cnn_info.json +0 -1
  66. data/test/fixtures/google_info.json +0 -1
  67. data/test/fixtures/google_stats.json +0 -1
  68. data/test/fixtures/shorten_error.json +0 -1
  69. data/test/test_helper.rb +0 -39
@@ -1,28 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')
2
-
3
- class TestConfig < Minitest::Test
4
- context "bitly module" do
5
- should "create a new bitly v3 client through initializer" do
6
- # configure
7
- Bitly.configure do |config|
8
- config.api_version = 3
9
- config.login = login
10
- config.api_key = api_key
11
- config.timeout = 10
12
- end
13
- b = Bitly.client
14
- assert_equal Bitly::V3::Client, b.class
15
- end
16
-
17
- should "create a new bitly v2 client through initializer" do
18
- # configure
19
- Bitly.configure do |config|
20
- config.api_version = 2
21
- config.login = login
22
- config.api_key = api_key
23
- end
24
- b = Bitly.client
25
- assert_equal Bitly::Client, b.class
26
- end
27
- end
28
- end
@@ -1,167 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')
2
-
3
- class TestUrl < Minitest::Test
4
- context "a new Bitly::Url" do
5
- should "require a login and api_key" do
6
- assert_raises ArgumentError do Bitly::Url.new end
7
- assert_raises ArgumentError do Bitly::Url.new(login) end
8
- assert_raises ArgumentError do Bitly::Url.new(nil, api_key) end
9
- end
10
- context "shortening" do
11
- context "with a long url" do
12
- setup do
13
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/shorten\?.*longUrl=.*cnn.com.*$/,"cnn.json")
14
- @url = Bitly::Url.new(login, api_key, :long_url => 'http://cnn.com/')
15
- end
16
- should "return a short url" do
17
- assert_equal "http://bit.ly/15DlK", @url.shorten
18
- end
19
- should "create bitly and jmp urls" do
20
- @url.shorten
21
- assert_equal "http://bit.ly/15DlK", @url.bitly_url
22
- assert_equal "http://j.mp/15DlK", @url.jmp_url
23
- end
24
- end
25
- context "with no long url" do
26
- setup do
27
- @url = Bitly::Url.new(login, api_key)
28
- end
29
- should "raise an error" do
30
- assert_raises ArgumentError do
31
- @url.shorten
32
- end
33
- end
34
- end
35
- context "with a short url already" do
36
- setup do
37
- @url = Bitly::Url.new(login, api_key, :short_url => 'http://bit.ly/31IqMl')
38
- flexmock(@url).should_receive(:create_url).never
39
- end
40
- should "not need to call the api" do
41
- assert_equal "http://bit.ly/31IqMl", @url.shorten
42
- end
43
- end
44
- end
45
- context "expanding" do
46
- context "with a hash" do
47
- setup do
48
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/expand\?.*hash=31IqMl.*$/,"expand_cnn.json")
49
- @url = Bitly::Url.new(login, api_key, :hash => '31IqMl')
50
- end
51
- should "return an expanded url" do
52
- assert_equal "http://cnn.com/", @url.expand
53
- end
54
- end
55
- context "with a short url" do
56
- setup do
57
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/expand\?.*hash=31IqMl.*$/,"expand_cnn.json")
58
- @url = Bitly::Url.new(login, api_key, :short_url => 'http://bit.ly/31IqMl')
59
- end
60
- should "return an expanded url" do
61
- assert_equal "http://cnn.com/", @url.expand
62
- end
63
- end
64
- context "with no short url or hash" do
65
- setup do
66
- @url = Bitly::Url.new(login, api_key)
67
- end
68
- should "raise an error" do
69
- assert_raises ArgumentError do
70
- @url.expand
71
- end
72
- end
73
- end
74
- context "with a long url already" do
75
- setup do
76
- @url = Bitly::Url.new(login, api_key, :long_url => 'http://google.com')
77
- flexmock(@url).should_receive(:create_url).never
78
- end
79
- should "not need to call the api" do
80
- assert_equal "http://google.com", @url.expand
81
- end
82
- end
83
- end
84
- context "info" do
85
- context "with a hash" do
86
- setup do
87
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/info\?.*hash=3j4ir4.*$/,"google_info.json")
88
- @url = Bitly::Url.new(login, api_key, :hash => '3j4ir4')
89
- end
90
- should "return info" do
91
- assert_equal "Google", @url.info['htmlTitle']
92
- end
93
- end
94
- context "with a short url" do
95
- setup do
96
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/info\?.*hash=3j4ir4.*$/,"google_info.json")
97
- @url = Bitly::Url.new(login, api_key, :short_url => 'http://bit.ly/3j4ir4')
98
- end
99
- should "return an expanded url" do
100
- assert_equal "Google", @url.info['htmlTitle']
101
- end
102
- end
103
- context "without a short url or hash" do
104
- setup do
105
- @url = Bitly::Url.new(login, api_key, :long_url => 'http://google.com')
106
- end
107
- should "raise an error" do
108
- assert_raises ArgumentError do
109
- @url.info
110
- end
111
- end
112
- end
113
- context "with info already" do
114
- setup do
115
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/info\?.*hash=3j4ir4.*$/,"google_info.json")
116
- @url = Bitly::Url.new(login, api_key, :short_url => 'http://bit.ly/3j4ir4')
117
- @url.info
118
- end
119
- should "not call the api twice" do
120
- flexmock(@url).should_receive(:create_url).never
121
- @url.info
122
- end
123
- end
124
- end
125
- context "stats" do
126
- context "with a hash" do
127
- setup do
128
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/stats\?.*hash=3j4ir4.*$/,"google_stats.json")
129
- @url = Bitly::Url.new(login, api_key, :hash => '3j4ir4')
130
- end
131
- should "return info" do
132
- assert_equal 2644, @url.stats['clicks']
133
- end
134
- end
135
- context "with a short url" do
136
- setup do
137
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/stats\?.*hash=3j4ir4.*$/,"google_stats.json")
138
- @url = Bitly::Url.new(login, api_key, :short_url => 'http://bit.ly/3j4ir4')
139
- end
140
- should "return an expanded url" do
141
- assert_equal 2644, @url.stats['clicks']
142
- end
143
- end
144
- context "without a short url or hash" do
145
- setup do
146
- @url = Bitly::Url.new(login, api_key, :long_url => 'http://google.com')
147
- end
148
- should "raise an error" do
149
- assert_raises ArgumentError do
150
- @url.stats
151
- end
152
- end
153
- end
154
- context "with info already" do
155
- setup do
156
- stub_get(/^https:\/\/api-ssl\.bitly\.com\/stats\?.*hash=3j4ir4.*$/,"google_stats.json")
157
- @url = Bitly::Url.new(login, api_key, :short_url => 'http://bit.ly/3j4ir4')
158
- @url.stats
159
- end
160
- should "not call the api twice" do
161
- flexmock(@url).should_receive(:create_url).never
162
- @url.stats
163
- end
164
- end
165
- end
166
- end
167
- end
@@ -1,79 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', 'test_helper.rb')
2
-
3
- class TestUtils < Minitest::Test
4
- include Bitly::Utils
5
- API_VERSION = '2.0.1'
6
-
7
- context "text utils" do
8
- should "underscore a word" do
9
- assert_equal "hello_world", underscore("HelloWorld")
10
- end
11
- should "create a hash from a bitly url" do
12
- assert_equal "hello", create_hash_from_url("http://bit.ly/hello")
13
- end
14
- should "create a hash from a jmp url" do
15
- assert_equal "hello", create_hash_from_url("http://j.mp/hello")
16
- end
17
- end
18
-
19
- context "class utils" do
20
- should "turn a key value pair into an instance variable" do
21
- attr_define('hello','goodbye')
22
- assert_equal @hello, "goodbye"
23
- end
24
-
25
- should "turn a hash into instance variables" do
26
- instance_variablise({'hello' => 'goodbye'}, ['hello'])
27
- assert_equal @hello, "goodbye"
28
- end
29
-
30
- should "not turn nonspecified variables into instance variables" do
31
- instance_variablise({'hello' => 'goodbye'}, [])
32
- assert !(defined? @hello)
33
- end
34
- end
35
-
36
- context "creating a url" do
37
- setup do
38
- @api_key = api_key
39
- @login = login
40
- end
41
- should "contain all the basic information" do
42
- url = create_url.to_s
43
- assert url.include?('https://api-ssl.bitly.com/')
44
- assert url.include?("version=#{API_VERSION}")
45
- assert url.include?("apiKey=#{api_key}")
46
- assert url.include?("login=#{login}")
47
- end
48
- should "contain the right resource" do
49
- url = create_url('shorten').to_s
50
- assert url.include?('/shorten')
51
- end
52
- should "contain extra parameters" do
53
- url = create_url('shorten', :longUrl => 'http://google.com').to_s
54
- assert url.include?("longUrl=#{CGI.escape('http://google.com')}")
55
- end
56
- end
57
-
58
- context "fetching a url" do
59
- context "successfully" do
60
- setup do
61
- stub_get("http://example.com","cnn.json")
62
- end
63
- should "return a json object successfully" do
64
- result = get_result(URI.join("http://example.com"))
65
- assert_equal Hash, result.class
66
- end
67
- end
68
- context "unsuccessfully" do
69
- setup do
70
- stub_get("http://example.com", 'shorten_error.json')
71
- end
72
- should "raise BitlyError" do
73
- assert_raises BitlyError do
74
- get_result(URI.join("http://example.com"))
75
- end
76
- end
77
- end
78
- end
79
- end
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "http://cnn.com": { "hash": "31IqMl", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/15DlK", "userHash": "15DlK" } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "http://cnn.com": { "hash": "31IqMl", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/15DlK", "userHash": "15DlK" }, "http://google.com": { "hash": "3j4ir4", "shortKeywordUrl": "", "shortUrl": "http://bit.ly/11etr", "userHash": "11etr" } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "31IqMl": { "longUrl": "http://cnn.com/" } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "15DlK": { "longUrl": "http://cnn.com/" }, "3j4ir4": { "longUrl": "http://google.com/" } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "31IqMl": { "calais": {}, "calaisId": "", "calaisResolutions": {}, "contentLegth": 284.0, "contentLength": "", "contentType": "text/html", "exif": {}, "fileExtension": "", "globalHash": "31IqMl", "hash": "31IqMl", "htmlMetaDescription": "CNN.com delivers the latest breaking news and information on the latest top stories, weather, business, entertainment, politics, and more. For in-depth coverage, CNN.com provides special reports, video, audio, photo galleries, and interactive guides.", "htmlMetaKeywords": [ "CNN", "CNN news", "CNN.com", "CNN TV", "news", "news online", "breaking news", "U.S. news", "world news", "weather", "business", "CNN Money", "sports", "politics", "law", "technology", "entertainment", "education", "travel", "health", "special reports", "autos", "developing story", "news video", "CNN Intl" ], "htmlTitle": "CNN.com - Breaking News, U.S., World, Weather, Entertainment & Video News", "id3": {}, "indexed": 1246563927, "keyword": "", "keywords": [], "longUrl": "http://cnn.com/", "metacarta": [], "mirrorUrl": "", "shortenedByUser": "bitly", "surbl": 0, "thumbnail": { "large": "http://s.bit.ly/bitly/31IqMl/thumbnail_large.png", "medium": "http://s.bit.ly/bitly/31IqMl/thumbnail_medium.png", "small": "http://s.bit.ly/bitly/31IqMl/thumbnail_small.png" }, "urlFetched": "http://www.cnn.com/", "userHash": "", "users": [ "shmooved", "bitlybookmarklet", "thepalermoproject", "soundcloud", "todd", "johnb", "gfc", "selias22", "heme", "heavensrevenge", "tedroden", "showpopr", "toma", "invokemedia", "jonsteinberg", "shmoop", "crkn", "spol", "neilw", "superamit", "tadwook", "timkl", "elmerfudd", "directeur", "jamescrowley", "tickerhound", "twitterhound", "mobilemind", "thismagazine", "mpminer", "nok", "eljojo", "dumpkopf", "spreadmob", "nishith", "chorrell", "dave", "isayel", "revrev", "ideacol", "adelevie", "b2c", "zen", "tweepletwak", "stephdau", "jeton", "hiteck", "sonidolocal", "cavorite", "jay", "rajeshkp", "mailplane", "sbtodd", "bitohoney", "detect", "artd", "ivankirigin", "NeilCrosby", "mskadu", "dmpro", "millette", "mm", "aweissman", "nearlybot", "ajasver", "orenus", "yunfan", "vipeers", "michel", "spraycode", "fidlr", "supersuf", "abernathy", "zellmi", "kortina", "bitlyapidemo", "hp", "bojonas", "nickware", "adenner", "sigepjedi", "austinhill", "tigol", "vranx", "fabinho", "simonches", "RichMann", "claystreet", "trendly", "mzehrer", "TheN2S", "ffo", "mcgarty", "unquabain", "d", "springpad", "motuit", "sandya", "jstautz", "polymergirl", "HED", "colbypalmer", "patched", "vx", "trailerreview", "backtype", "nukirk", "tmadge", "garrettw", "runk", "dbingham", "ckaroli", "hsetty", "sharpshoot", "mamund", "gestes", "thesethings", "propel", "marsrc", "halvfet", "berberich", "imath", "mahawkins", "hayduke", "icecoldnews", "bren", "claudine", "munim", "utatane", "tanel", "karuizawa", "hpduong", "fewill", "JDM", "indbs", "chaodoze", "haydenonline", "matyyy", "shanink", "roguepost", "chad", "emrox", "bitlyspreadsheets", "evansolomon", "milq", "twitterfeed", "tweetieapp", "massless", "khuckvale", "iminlikewithyou", "bumpasaurus@gmail.com", "htmiguel", "shorter", "eh270", "Joe", "twittergadget", "quotd", "scotster", "bitlypreview", "gavola", "banterability", "SocialScope", "justhunger", "d2kagw", "Sam@TheCellist42.com", "manderson_ohio@yahoo.com", "bensmithuk", "gamers600", "magicquotes", "tweetthis", "ubervu", "bitlybox", "toledorodney", "retaggr", "sedwot", "Kersny", "bcse", "andy@commadelimited.com", "sreenivas", "z33m", "urlpackager", "dpjanes", "philnash", "bassdread", "Siriquelle", "trixtur", "austinmoody", "tav", "ivansf", "jfredson", "xklark", "srijken", "ttomegachunk", "AsaBerd", "softronic", "bfo", "royboyjoytoy2", "danl", "noelb", "thingsinjars", "commadelimited", "wanderingstan", "tweetdeckapi", "littlesnapper", "tweetmeme", "jps", "droolr", "man0l", "portaldofregues", "jugo", "ktgy", "twitterrific", "elbertf", "shareaholic", "rayd", "kengeo", "api@zensify.com", "shoutnow", "teisam", "bguthrie", "besttechdeals", "zensify", "icyou", "dwellicious", "raven", "kcu", "najimi", "howardbaines", "fitzage", "domado16", "tc", "bradarsenault", "trendyobot", "powertwitter", "netpro2k", "concerthash", "twtcode", "lizzer", "mefeed", "zacwest", "nleveler", "emendappdev", "emendapp", "redbassett", "epage", "codemypantsoff", "Urgo", "calais", "outbrain", "razorfishca", "toutmontreal", "quietube", "twiggler", "samlii", "userfly", "abrahamlloyd", "carlsverre", "dunkjmcd", "rubenolsen", "quotablebooks", "4gemedia", "rival", "operaportal", "charitybuzz", "brant", "chartbeat", "tweeklyfm", "ronn", "concept52", "coupa", "owlread", "scottkarp", "linkbitch", "vodpod", "slashgear", "arnaudsj", "bootstrap", "earthclassmail", "unhub", "kiko", "coldkeyboard", "madnashua", "fabiopili", "kaspar", "larrynichols", "trustmap", "codepress", "tivowatcher", "rossimo", "twhirl", "shanzynga", "ghuru", "allgamblingnews", "betternet", "edwinwang", "jarred", "picnik", "thismoment", "zocdoc", "thetechmogul", "rajesh", "yotify", "brad", "northisup", "dsa", "endurancejunkies", "mybooo", "geekboys", "prit", "altosresearch", "haitai", "vinhkhanhit", "gymsnearby", "snuten", "inewsapp", "flipflopr", "plexium", "cotweet", "mytrade", "wertletheturtle", "joestump", "zimmeee", "dcinzona", "nagesh", "thinkphp", "dailyfill", "vijaypatil", "amarkova1982", "vdibart", "keineahnung", "roosterteeth", "masterbaytor", "eightlines", "boctor", "crunch", "kbychu", "modaira", "sysdomatic", "jeffreytierney", "neonova", "theschnaz", "ez", "feedmy", "twitterauction", "twikini", "johnnywander", "fdeguzman", "oriolfb", "taftech", "mressay", "tbbtsite", "pricegrab", "dbperry", "peraperaprv", "atrothman223", "kcbigring", "theseries", "docgroove", "connections", "mab", "james", "cweider", "mistabell", "glennpmn", "mecravem", "icssidearm", "lewiswebdev", "philipecoutinho", "rmo", "takkyun", "to", "tweetvisor", "bim", "smonev", "krisempire", "petercasier", "laitaowa", "LaptopHeaven", "ruggedelegance", "odtv", "laz75", "eight7teen", "tweetevents", "gamespress", "elfster", "bobbyjason", "matlab", "fanfou", "rakurakuinc", "yegle", "dativestudios", "articleslash", "jrcdude", "adslzone", "shortmoney", "cutethingsinbed", "nealkerickson", "tootairapp", "gksperling", "tzangms", "jparkers", "textcube", "cmccann", "linuxkido", "noviceprogram", "voltron43", "aroussi", "turkerz", "janbui", "stockshouter", "mozbox", "nibirutech", "brotchie", "darkua", "wsmith", "t24kurage", "bodu", "imified", "vgdotd", "chcf", "everynumberone", "tweetnewz", "catshelpdesk", "simplybox", "dailyroads", "cookbot", "anirig", "gamesbond", "invernizzi", "fekaylius", "changents", "vanmacguy", "trendytweetsbitly", "adiumofficial", "webmeme", "leedumond", "jyro", "michaeld", "nsls", "crypto", "karthicksethu", "petermorano", "glipt", "rubayeet", "cutiethread", "insane", "pivotaltweed", "AdamHertz", "merchants", "industrie", "kaku1969", "xtw", "eanders", "discocreative", "astexception", "raineandhorne", "sparwelt", "kabayan", "image01", "tweetquip", "ischa", "godrops", "360works", "pasteshot", "jfinegold", "textlogic", "jmgtan", "aaronrussell", "iwasinturkey", "mattpowell", "captainstupid", "jove", "timanrebel", "delicious", "danielrehner", "aaldrich", "mychurch", "pareshvarde", "shrisha", "earlyshen", "dailymile", "hashads", "jopie", "feedalizr", "kennstdueinen", "md117", "cliqz", "newrelic", "milanzajic", "inkzee", "mikecosentino", "twilightaktuell", "rjae", "kelvinator44", "jobomix", "vitalik", "feedagg", "changcommaalex", "tzah", "24ur", "jobcast", "toratto", "talkwit", "metricstaxi", "nzeltzer", "alexweber", "goodwill", "streetfire", "jurai", "cpgroups", "emptyspaceads", "googlenewsjp", "craigae", "2night", "eoxlive", "kijijicanada", "wiglu", "openaccessweek", "anyclip", "dz0ny", "bawigga", "spazcore", "spazcer", "kevinmarks", "casarotti", "dpctest", "efusionid", "annstark", "cristdrive", "r2d2", "elwoodicious", "infopirat", "snoxd", "codejunky1", "sp33dfr34ksd", "jumpinggrendel", "optifyshorten", "oodlelistings", "blainetology", "iproperty", "twtbks", "prashantm", "drry", "chango", "jreynar", "rdaum", "kikinshare", "odinjobs", "wegame", "twse", "beatter", "launchset", "lyricskeeper", "wolfgang", "clickability", "yamli", "alexbosworth", "cashiesuktest", "meateam", "abartling", "fresheneesz", "dangerbell", "proxifeed", "twatme", "boyplankton", "wbio", "skychirp", "slideshare", "keepertestaccount", "valerietaesch", "splab", "gameproapi", "chssystems", "gobyo", "altcanvas", "ankitparekh", "dylanreeve", "sponsorlab", "socialdeck", "denisgurski", "boblog", "dprothro", "syberplanet", "marcparadise", "moneymakerhyip", "chrisedgemon", "camthompson", "nassersala", "meloco32", "ibiboisms", "mesodata", "jewishtimes", "izual", "infosage", "wac", "googlebooks", "buddybrain", "monk", "krishnan", "dothetest", "aktnow", "solmeliacuba" ], "version": 1.0 }, "3j4ir4": { "calais": {}, "calaisId": "", "calaisResolutions": {}, "contentLength": "", "contentType": "text/html; charset=ISO-8859-1", "exif": {}, "globalHash": "3j4ir4", "hash": "3j4ir4", "htmlMetaDescription": "", "htmlMetaKeywords": "", "htmlTitle": "Google", "id3": {}, "keyword": "", "keywords": [], "longUrl": "http://google.com/", "metacarta": [], "mirrorUrl": "", "shortenedByUser": "bitly", "surbl": 0, "thumbnail": { "large": "http://s.bit.ly/bitly/3j4ir4/thumbnail_large.png", "medium": "http://s.bit.ly/bitly/3j4ir4/thumbnail_medium.png", "small": "http://s.bit.ly/bitly/3j4ir4/thumbnail_small.png" }, "userHash": "", "users": [ "kortina", "jay", "bitlybookmarklet", "runcible", "ideacol", "spol", "adrian33", "debajit", "follow", "cosmic", "bitlyspreadsheets", "bitlyapidemo", "mskadu", "betons42", "colbypalmer", "derekpcollins", "enricus", "twitchboard", "massless", "grader", "nickware", "GeekLad", "bumpasaurus@gmail.com", "wac", "planetsdb", "bitlypreview", "twittergadget", "htmiguel", "shorter", "movies", "books", "tunes", "amelnikova", "Sam@TheCellist42.com", "samferry", "tboid", "manderson_ohio@yahoo.com", "benshead", "tbc", "gabe", "shmooved", "tweetieapp", "tweetthis", "mannincw", "newsx", "thefireus", "bitlybox", "chirp", "ashit@jooners.com", "z33m", "urlpackager", "philnash", "sreenivas", "lagiator", "kissmetrics", "matthewfl", "bobbyw", "cotweet", "alexannese", "richardxthripp", "tanel", "jfredson", "lynettechandler", "louismirra", "mattrobs", "stillframe", "ttomegachunk", "Inverted", "falicon", "royboyjoytoy2", "psifertex", "Dien", "tweetdeckapi", "dropiodev", "jasonkhanlar", "tweetalink", "commadelimited", "bck", "bigbig", "cspath", "bitlytextmate", "addtoany", "fitfindr", "adenner", "maximz2005", "grigs", "spipeshop", "omgig", "kortina101", "c4rves", "thingsinjars", "matthewfallshaw", "bguthrie", "powertwitter", "reduxo", "tweettrackjs", "loucypher", "nullwaver", "troynt", "bseanvt", "tc", "theonion", "dahammer", "twtcode", "mefeed", "emendapp", "emendappdev", "outbrain", "redbassett", "calais", "eurleif", "digomatic", "mc", "garno", "obbyyoyo", "lollapalooza", "twitscoop", "carlsverre", "ktgy", "cstejerean", "4gemedia", "zakgrim", "owlread", "ratsgoboom", "jayhickey", "emojitales", "ringlerun", "kupona", "renjithdas", "copress", "larrynichols", "bitlify", "pathfinder", "searchengineland", "raaartrex", "unhub", "twhirl", "rossimo", "cvertex", "spam4aj", "rrs", "mattietk", "jfdurocher", "josephscott", "imharoon2003", "pope52", "alexmg", "askyourtango", "rajesh", "tejas", "rubsta", "completelynovel", "hi675", "collegejersey", "altosresearch", "haitai", "gymsnearby", "artfire", "vision2000", "ivansf", "polymar", "anadeau", "wealltv", "arc90", "demnow", "labria", "wertletheturtle", "kiwiscanfly", "oliverash", "alexcvo", "dcinzona", "uservoice", "bwillums", "zupadupa", "feedmy", "corinne", "askme", "twikini", "chango", "mp3bible", "agqnetwork", "taftech", "atrothman223", "tbbtsite", "firerabbit", "spbose", "spellrus", "fn7", "bsd4pl", "groupcard", "monitter", "cweider", "mistabell", "ayn", "miki", "twitterrific", "bim", "seb2point0", "moomerman", "avilasexy", "zachera", "ksharkey", "obijan", "lostfilm", "magicscientist", "hmi", "ruggedelegance", "mogeethis", "nishantmodak", "talagy1", "delicious", "nickt", "opccalendar", "brightbold", "samuel", "gnintendo", "aurorafeint", "pkumat", "spinnaker", "opinmind", "drawohara", "ideelitest", "voltron43", "jolleyjoe", "orionlee", "fastdove", "stockshouter", "scrabbly", "darkua", "thangamkvp", "kanjifandom", "360hubs", "vivocom", "jepeng", "joemccann", "allynbauer", "destroytwitter", "medium", "bpark08", "twitknights", "adiumofficial", "leedumond", "confluxgroup", "40limbo", "cwalcott", "karthicksethu", "pron", "planettagger", "switchonthecode", "izeasponsoredtweets", "merchants", "humptydumptyegg", "user121", "andav", "cutiethread", "vmarquez", "hopkinsju", "tweetsimple", "saasbit", "aaad", "gohewitt", "yusuke0927", "vinced45", "fbmore", "northisup", "tt01311", "bleetbox", "gyokojp", "dentest", "headlineshirts", "gethighnote", "hashads", "racevine", "kelvinator44", "ajc308", "tweetw", "ibanezyaya", "abiko", "goseedo", "tzah", "gimmeanswers", "twitiq", "lehrblogger", "metricstaxi", "nzeltzer", "addly", "scph", "jrcdude", "mderk", "pullus", "googlenewsjp", "rjinla", "smithworx", "antiuser", "injeqt", "lovelykby", "wiglu", "demandspot", "spazcore", "ka2hiro", "namnum", "sventures", "twittersales", "buttreygoodness", "nagesh", "tribescape", "ohun002", "orsiso", "orymate", "yossilac", "klango", "sp33dfr34ksd", "tracksite", "tonysteward", "davidwalshblog", "ramses", "rdaum", "ookong", "pieceoflena", "wowgather", "caribryne", "alexbosworth", "apoenam", "keepertestaccount", "slideshare", "splab", "ankitparekh", "xtips", "hexmode", "ryanl229", "syberplanet", "gotwalt", "othman", "bunte", "tmeryu", "e", "pjstadig", "timi", "retweetjs", "sobees" ], "version": 1.0 } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "3j4ir4": { "calais": {}, "calaisId": "", "calaisResolutions": {}, "contentLength": "", "contentType": "text/html; charset=ISO-8859-1", "exif": {}, "globalHash": "3j4ir4", "hash": "3j4ir4", "htmlMetaDescription": "", "htmlMetaKeywords": "", "htmlTitle": "Google", "id3": {}, "keyword": "", "keywords": [], "longUrl": "http://google.com/", "metacarta": [], "mirrorUrl": "", "shortenedByUser": "bitly", "surbl": 0, "thumbnail": { "large": "http://s.bit.ly/bitly/3j4ir4/thumbnail_large.png", "medium": "http://s.bit.ly/bitly/3j4ir4/thumbnail_medium.png", "small": "http://s.bit.ly/bitly/3j4ir4/thumbnail_small.png" }, "userHash": "", "users": [ "kortina", "jay", "bitlybookmarklet", "runcible", "ideacol", "spol", "adrian33", "debajit", "follow", "cosmic", "bitlyspreadsheets", "bitlyapidemo", "mskadu", "betons42", "colbypalmer", "derekpcollins", "enricus", "twitchboard", "massless", "grader", "nickware", "GeekLad", "bumpasaurus@gmail.com", "wac", "planetsdb", "bitlypreview", "twittergadget", "htmiguel", "shorter", "movies", "books", "tunes", "amelnikova", "Sam@TheCellist42.com", "samferry", "tboid", "manderson_ohio@yahoo.com", "benshead", "tbc", "gabe", "shmooved", "tweetieapp", "tweetthis", "mannincw", "newsx", "thefireus", "bitlybox", "chirp", "ashit@jooners.com", "z33m", "urlpackager", "philnash", "sreenivas", "lagiator", "kissmetrics", "matthewfl", "bobbyw", "cotweet", "alexannese", "richardxthripp", "tanel", "jfredson", "lynettechandler", "louismirra", "mattrobs", "stillframe", "ttomegachunk", "Inverted", "falicon", "royboyjoytoy2", "psifertex", "Dien", "tweetdeckapi", "dropiodev", "jasonkhanlar", "tweetalink", "commadelimited", "bck", "bigbig", "cspath", "bitlytextmate", "addtoany", "fitfindr", "adenner", "maximz2005", "grigs", "spipeshop", "omgig", "kortina101", "c4rves", "thingsinjars", "matthewfallshaw", "bguthrie", "powertwitter", "reduxo", "tweettrackjs", "loucypher", "nullwaver", "troynt", "bseanvt", "tc", "theonion", "dahammer", "twtcode", "mefeed", "emendapp", "emendappdev", "outbrain", "redbassett", "calais", "eurleif", "digomatic", "mc", "garno", "obbyyoyo", "lollapalooza", "twitscoop", "carlsverre", "ktgy", "cstejerean", "4gemedia", "zakgrim", "owlread", "ratsgoboom", "jayhickey", "emojitales", "ringlerun", "kupona", "renjithdas", "copress", "larrynichols", "bitlify", "pathfinder", "searchengineland", "raaartrex", "unhub", "twhirl", "rossimo", "cvertex", "spam4aj", "rrs", "mattietk", "jfdurocher", "josephscott", "imharoon2003", "pope52", "alexmg", "askyourtango", "rajesh", "tejas", "rubsta", "completelynovel", "hi675", "collegejersey", "altosresearch", "haitai", "gymsnearby", "artfire", "vision2000", "ivansf", "polymar", "anadeau", "wealltv", "arc90", "demnow", "labria", "wertletheturtle", "kiwiscanfly", "oliverash", "alexcvo", "dcinzona", "uservoice", "bwillums", "zupadupa", "feedmy", "corinne", "askme", "twikini", "chango", "mp3bible", "agqnetwork", "taftech", "atrothman223", "tbbtsite", "firerabbit", "spbose", "spellrus", "fn7", "bsd4pl", "groupcard", "monitter", "cweider", "mistabell", "ayn", "miki", "twitterrific", "bim", "seb2point0", "moomerman", "avilasexy", "zachera", "ksharkey", "obijan", "lostfilm", "magicscientist", "hmi", "ruggedelegance", "mogeethis", "nishantmodak", "talagy1", "delicious", "nickt", "opccalendar", "brightbold", "samuel", "gnintendo", "aurorafeint", "pkumat", "spinnaker", "opinmind", "drawohara", "ideelitest", "voltron43", "jolleyjoe", "orionlee", "fastdove", "stockshouter", "scrabbly", "darkua", "thangamkvp", "kanjifandom", "360hubs", "vivocom", "jepeng", "joemccann", "allynbauer", "destroytwitter", "medium", "bpark08", "twitknights", "adiumofficial", "leedumond", "confluxgroup", "40limbo", "cwalcott", "karthicksethu", "pron", "planettagger", "switchonthecode", "izeasponsoredtweets", "merchants", "humptydumptyegg", "user121", "andav", "cutiethread", "vmarquez", "hopkinsju", "tweetsimple", "saasbit", "aaad", "gohewitt", "yusuke0927", "vinced45", "fbmore", "northisup", "tt01311", "bleetbox", "gyokojp", "dentest", "headlineshirts", "gethighnote", "hashads", "racevine", "kelvinator44", "ajc308", "tweetw", "ibanezyaya", "abiko", "goseedo", "tzah", "gimmeanswers", "twitiq", "lehrblogger", "metricstaxi", "nzeltzer", "addly", "scph", "jrcdude", "mderk", "pullus", "googlenewsjp", "rjinla", "smithworx", "antiuser", "injeqt", "lovelykby", "wiglu", "demandspot", "spazcore", "ka2hiro", "namnum", "sventures", "twittersales", "buttreygoodness", "nagesh", "tribescape", "ohun002", "orsiso", "orymate", "yossilac", "klango", "sp33dfr34ksd", "tracksite", "tonysteward", "davidwalshblog", "ramses", "rdaum", "ookong", "pieceoflena", "wowgather", "caribryne", "alexbosworth", "apoenam", "keepertestaccount", "slideshare", "splab", "ankitparekh", "xtips", "hexmode", "ryanl229", "syberplanet", "gotwalt", "othman", "bunte", "tmeryu", "e", "pjstadig", "timi", "retweetjs", "sobees" ], "version": 1.0 } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 0, "errorMessage": "", "results": { "clicks": 2644, "hash": "31IqMl", "referrers": { "": { "/index.html": 1, "None": 5, "direct": 2003 }, "api.bit.ly": { "/shorten": 2 }, "benny-web": { "/jseitel/bitly/install.html": 1 }, "bit.ly": { "/": 3, "/app/demos/info.html": 71, "/app/demos/stats.html": 305, "/app/demos/statsModule.html": 2, "/info/15DlK": 1, "/info/27I9Ll": 1, "/info/31IqMl": 2, "/info/hic4E": 1 }, "code.google.com": { "/p/bitly-api/wiki/ApiDocumentation": 1 }, "dev.chartbeat.com": { "/static/bitly.html": 1 }, "dev.unhub.com": { "/pnG8/": 1 }, "klout.net": { "/profiledetail.php": 1 }, "localhost": { "/New Folder/test1.php": 1 }, "mail.google.com": { "/mail/": 1 }, "partners.bit.ly": { "/td": 8 }, "powertwitter.me": { "/": 1 }, "quietube.com": { "/getbitly.php": 1 }, "search.twitter.com": { "/search": 3 }, "sfbay.craigslist.org": { "/sfc/rnr/891043787.html": 8 }, "spreadsheets.google.com": { "/ccc": 23, "/ccc2": 1 }, "strat.corp.advertising.com": { "/brandmaker/bitly.php": 4 }, "taggytext.com": { "/ganja": 1 }, "twitter.com": { "/": 3, "/SuperTestAcct": 1, "/TattoosOn": 1, "/WilliamWoods": 1, "/home": 6, "/ibiboisms": 2, "/kshanns": 1, "/matraji": 1, "/nathanfolkman": 1, "/pantaleonescu": 1, "/rubyisbeautiful": 1, "/williamwoods": 1 }, "twitturls.com": { "/": 21 }, "twitturly.com": { "": 17, "/urlinfo/url/2168a5e81280538cdbf6ad4c4ab019db/": 1 }, "url.ly": { "/": 19, "/info/27I9Ll": 1, "/info/31IqMl": 3 }, "urly.local:3600": { "/": 7 }, "v2.blogg.no": { "/test.cfm": 1 }, "www.facebook.com": { "/home.php": 1 }, "www.longurlplease.com": { "/": 3 }, "www.microblogbuzz.com": { "": 5 } } }, "statusCode": "OK" }
@@ -1 +0,0 @@
1
- { "errorCode": 1, "errorMessage": "Test error", "statusCode": "ERROR" }
@@ -1,39 +0,0 @@
1
- require 'minitest/autorun'
2
- require 'rubygems'
3
- require 'shoulda'
4
- require 'flexmock/minitest'
5
- require 'webmock/minitest'
6
-
7
- require File.join(File.dirname(__FILE__), '..', 'lib', 'bitly')
8
-
9
- WebMock.disable_net_connect!
10
- WebMock::Config.instance.query_values_notation = :flat_array
11
-
12
- def fixture_file(filename)
13
- return '' if filename == ''
14
- file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
15
- File.read(file_path)
16
- end
17
-
18
- def stub_get(url, filename, status=nil)
19
- options = {:body => fixture_file(filename)}
20
- options.merge!({:status => status}) unless status.nil?
21
-
22
- stub_request(:get, url).to_return(options)
23
- end
24
-
25
- def api_key
26
- 'test_key'
27
- end
28
- def login
29
- 'test_account'
30
- end
31
- def access_token
32
- 'test_access_token'
33
- end
34
-
35
- class Minitest::Test
36
- def teardown
37
- WebMock.reset!
38
- end
39
- end