Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Intial commit

  • Loading branch information...
commit 249febf21069f720bf7e432a31629bce5993af21 0 parents
@holman authored
5 .gitignore
@@ -0,0 +1,5 @@
+*.gem
+pkg
+doc
+.DS_Store
+Rakefile
34 README.markdown
@@ -0,0 +1,34 @@
+## brightkitey
+
+by [Zach Holman](http://zachholman.com) ([brightkite](http://brightkite.com/people/holman))
+
+brightkitey is a cute little wrapper around Brightkite's API. It's possibly horribly broken and incomplete; but it's getting there. Pull requests welcome and appreciated.
+
+## installation and usage
+
+## thanks
+
+## license
+
+(The MIT License)
+
+Copyright (c) 2008 Zach Holman
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
66 lib/brightkitey.rb
@@ -0,0 +1,66 @@
+require 'rubygems'
+require 'activeresource'
+
+module Brightkitey
+ VERSION = '0.0.1'
+
+ class << self
+ def authenticate(user, password)
+ Brightkitey::Base.user = user
+ Brightkitey::Base.password = password
+ end
+ end
+
+ class Base < ActiveResource::Base
+ def self.inherited(base)
+ base.site = "http://brightkite.com/"
+ base.element_name = base.to_s.split('::').last.downcase
+ super
+ end
+ end
+
+ class Checkin < Base
+ end
+
+ class Comment < Base
+ end
+
+ class Note < Base
+ end
+
+ class Objekt < Base
+ end
+
+ class Person < Base
+ def checkins
+ Checkin.find(:all, :from => "/people/#{login}/objects.xml", :params => {:filters => :checkins})
+ end
+
+ def checkins
+ Note.find(:all, :from => "/people/#{login}/objects.xml", :params => {:filters => :notes})
+ end
+
+ def photos
+ Photo.find(:all, :from => "/people/#{login}/objects.xml", :params => {:filters => :photos})
+ end
+
+ def objects(options = {})
+ Objekt.find(:all, :from => "/people/#{login}/search.xml", :params => options)
+ end
+ end
+
+ class Photo < Base
+ self.element_name = 'object'
+
+ def comments
+ Comment.find(:all, :from => "/objects/#{id}/comments")
+ end
+ end
+
+ class Place < Base
+ def checkins
+ Checkin.find(:all, :params => options.update(:project_id => id))
+ end
+ end
+
+end
6 spec/brightkitey_spec.rb
@@ -0,0 +1,6 @@
+require File.join(File.dirname(__FILE__), %w[spec_helper])
+
+describe Brightkitey do
+end
+
+# EOF
15 spec/spec_helper.rb
@@ -0,0 +1,15 @@
+require File.expand_path(
+ File.join(File.dirname(__FILE__), %w[.. lib brightkitey]))
+
+Spec::Runner.configure do |config|
+ # == Mock Framework
+ #
+ # RSpec uses it's own mocking framework by default. If you prefer to
+ # use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+end
+
+# EOF
Please sign in to comment.
Something went wrong with that request. Please try again.