Permalink
Browse files

updated the old and inconsistent fixtures

  • Loading branch information...
jeffkreeftmeijer committed Jul 15, 2009
1 parent de322f7 commit 086920745e3693ba8cbf01b96724cc0aebe40a72
View
@@ -15,17 +15,21 @@ def self.find(*args)
# count the posts
def self.count(options = {})
+
+ #puts balh = {:num => 1}.merge(options).to_yaml
response = Tumblr::Request.read({:num => 1}.merge(options))
+ if(options.empty?)
+ #puts response['tumblr']['posts'].to_yaml
+ #puts "*****"
+ end
response['tumblr']['posts']['total'].to_i
+
end
# find the first post
def self.find_initial(options)
total = self.count
- options = {:start => (total - 1), :num => 1} if(options.empty?)
-
- puts options.to_yaml
-
+ options = {:start => (total - 1), :num => 1} if(options.empty?)
response = Tumblr::Request.read(options)
return response['tumblr']['posts']['post'].first unless(options == {:start => (total - 1), :num => 1})
@@ -46,12 +50,15 @@ def self.find_every(options)
responses = []
amount.times do |count|
responses << Tumblr::Request.read(options.merge({:start => (count.to_i * 50)}))
+ #puts options.merge({:start => (count.to_i * 50)}).to_yaml
end
-
+
response = {'tumblr' => {'posts' => {'post' => []}}}
responses.each do |r|
r['tumblr']['posts']['post'].each { | p | response['tumblr']['posts']['post'] << p }
end
+
+ #puts response['tumblr']['posts']['post'].length.to_yaml
return [response['tumblr']['posts']['post']] unless(response['tumblr']['posts']['post'].is_a?(Array))
response['tumblr']['posts']['post']
@@ -1,39 +0,0 @@
-<tumblr version='1.0'>
-<tumblelog name='jeffkreeftmeijer' timezone='US/Eastern' title='Jeff Kreeftmeijer'>
-<feeds>
-<feed id='508097' url='http://twitter.com/statuses/user_timeline/8284992.rss' import-type='regular-no-title' next-update-in-seconds='1487' title='Twitter / jkreeftmeijer'/>
-</feeds>
-</tumblelog>
-<posts start='0' total='98'>
-<post id='140920842' url='http://jeffkreeftmeijer.tumblr.com/post/140920842' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140920842/making-final-tweaks-to-awesomescaffold-yes' type='regular' date-gmt='2009-07-13 18:26:57 GMT' date='Mon, 13 Jul 2009 14:26:57' unix-timestamp='1247509617' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2617420039' from-feed-id='508097'>
-<regular-body>Making final tweaks to AwesomeScaffold (yes, that&amp;#8217;s the name of the #rspec/#cucumber/#haml scaffold genegrator) for the initial commit. :)</regular-body>
-</post>
-<post id='140920832' url='http://jeffkreeftmeijer.tumblr.com/post/140920832' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140920832/yay-got-an-alpha-invite-to-kohive-checking-it' type='regular' date-gmt='2009-07-13 18:26:56 GMT' date='Mon, 13 Jul 2009 14:26:56' unix-timestamp='1247509616' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2617889835' from-feed-id='508097'>
-<regular-body>Yay! Got an alpha invite to @&lt;a href="http://twitter.com/kohive">kohive&lt;/a>. Checking it out now :) Thanks a lot @&lt;a href="http://twitter.com/EdwardVII">EdwardVII&lt;/a></regular-body>
-</post>
-<post id='140837000' url='http://jeffkreeftmeijer.tumblr.com/post/140837000' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140837000/just-updated-the-tumblr-ror-gem' type='regular' date-gmt='2009-07-13 15:38:07 GMT' date='Mon, 13 Jul 2009 11:38:07' unix-timestamp='1247499487' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2614945546' from-feed-id='508097'>
-<regular-body>just updated the #tumblr #ror #gem (&lt;a href="http://bit.ly/19G5uu">http://bit.ly/19G5uu&lt;/a>) Thanks a lot @&lt;a href="http://twitter.com/zapnap">zapnap&lt;/a>! :)</regular-body>
-</post>
-<post id='140742811' url='http://jeffkreeftmeijer.tumblr.com/post/140742811' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140742811/writing-cucumber-scenarios-for-the-scaffold' type='regular' date-gmt='2009-07-13 12:16:21 GMT' date='Mon, 13 Jul 2009 08:16:21' unix-timestamp='1247487381' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2612563426' from-feed-id='508097'>
-<regular-body>Writing cucumber scenarios for the scaffold generator. Pretty hard when you don&amp;#8217;t know what you&amp;#8217;re working with&amp;#8230;</regular-body>
-</post>
-<post id='140639182' url='http://jeffkreeftmeijer.tumblr.com/post/140639182' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140639182/would-love-to-be-able-to-auto-download-new-podcast' type='regular' date-gmt='2009-07-13 07:34:17 GMT' date='Mon, 13 Jul 2009 03:34:17' unix-timestamp='1247470457' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2610252266' from-feed-id='508097'>
-<regular-body>Would love to be able to auto-download new podcast episodes directly to my iPhone. (like iTunes does)</regular-body>
-</post>
-<post id='140639176' url='http://jeffkreeftmeijer.tumblr.com/post/140639176' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140639176/spent-some-time-writing-a-custom-rails-scaffold' type='regular' date-gmt='2009-07-13 07:34:16 GMT' date='Mon, 13 Jul 2009 03:34:16' unix-timestamp='1247470456' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2611048999' from-feed-id='508097'>
-<regular-body>Spent some time writing a custom rails scaffold generator the other day. It generates rspec and cucumber tests and uses haml for templating.</regular-body>
-</post>
-<post id='140639181' url='http://jeffkreeftmeijer.tumblr.com/post/140639181' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/140639181/girlfriend-bought-an-usb-flash-drive-it-came-with' type='regular' date-gmt='2009-07-13 07:34:16 GMT' date='Mon, 13 Jul 2009 03:34:16' unix-timestamp='1247470456' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2611009558' from-feed-id='508097'>
-<regular-body>Girlfriend bought an USB flash drive. It came with &amp;#8220;essential software&amp;#8221;: firefox, vlc and more free stuff. Awful sales strategy&amp;#8230;</regular-body>
-</post>
-<post id='139298154' url='http://jeffkreeftmeijer.tumblr.com/post/139298154' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/139298154/lyt-inman-great-serve' type='regular' date-gmt='2009-07-10 23:11:16 GMT' date='Fri, 10 Jul 2009 19:11:16' unix-timestamp='1247267476' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2575183864' from-feed-id='508097'>
-<regular-body>#lyt #inman, great serve!</regular-body>
-</post>
-<post id='139241528' url='http://jeffkreeftmeijer.tumblr.com/post/139241528' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/139241528/experience-with-using-cucumber-and-selenium' type='regular' date-gmt='2009-07-10 21:02:56 GMT' date='Fri, 10 Jul 2009 17:02:56' unix-timestamp='1247259776' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2573630826' from-feed-id='508097'>
-<regular-body>experience with using #cucumber and #selenium together? Anyone? #ror</regular-body>
-</post>
-<post id='139241541' url='http://jeffkreeftmeijer.tumblr.com/post/139241541' url-with-slug='http://jeffkreeftmeijer.tumblr.com/post/139241541/awesome-volley-by-shauninman-ghubaceks-last' type='regular' date-gmt='2009-07-10 21:02:56 GMT' date='Fri, 10 Jul 2009 17:02:56' unix-timestamp='1247259776' format='html' feed-item='http://twitter.com/jkreeftmeijer/statuses/2573104144' from-feed-id='508097'>
-<regular-body>awesome volley by @&lt;a href="http://twitter.com/shauninman">shauninman&lt;/a>. @&lt;a href="http://twitter.com/ghubacek">ghubacek&lt;/a>&amp;#8217;s last one was great too by the way&amp;#8230; #lyt</regular-body>
-</post>
-</posts>
-</tumblr>
Oops, something went wrong.

0 comments on commit 0869207

Please sign in to comment.