Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Intial commit

  • Loading branch information...
commit 249febf21069f720bf7e432a31629bce5993af21 0 parents
Zach Holman authored
5 .gitignore
... ... @@ -0,0 +1,5 @@
  1 +*.gem
  2 +pkg
  3 +doc
  4 +.DS_Store
  5 +Rakefile
34 README.markdown
Source Rendered
... ... @@ -0,0 +1,34 @@
  1 +## brightkitey
  2 +
  3 +by [Zach Holman](http://zachholman.com) ([brightkite](http://brightkite.com/people/holman))
  4 +
  5 +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.
  6 +
  7 +## installation and usage
  8 +
  9 +## thanks
  10 +
  11 +## license
  12 +
  13 +(The MIT License)
  14 +
  15 +Copyright (c) 2008 Zach Holman
  16 +
  17 +Permission is hereby granted, free of charge, to any person obtaining
  18 +a copy of this software and associated documentation files (the
  19 +'Software'), to deal in the Software without restriction, including
  20 +without limitation the rights to use, copy, modify, merge, publish,
  21 +distribute, sublicense, and/or sell copies of the Software, and to
  22 +permit persons to whom the Software is furnished to do so, subject to
  23 +the following conditions:
  24 +
  25 +The above copyright notice and this permission notice shall be
  26 +included in all copies or substantial portions of the Software.
  27 +
  28 +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  29 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  30 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  31 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  32 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  33 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  34 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
66 lib/brightkitey.rb
... ... @@ -0,0 +1,66 @@
  1 +require 'rubygems'
  2 +require 'activeresource'
  3 +
  4 +module Brightkitey
  5 + VERSION = '0.0.1'
  6 +
  7 + class << self
  8 + def authenticate(user, password)
  9 + Brightkitey::Base.user = user
  10 + Brightkitey::Base.password = password
  11 + end
  12 + end
  13 +
  14 + class Base < ActiveResource::Base
  15 + def self.inherited(base)
  16 + base.site = "http://brightkite.com/"
  17 + base.element_name = base.to_s.split('::').last.downcase
  18 + super
  19 + end
  20 + end
  21 +
  22 + class Checkin < Base
  23 + end
  24 +
  25 + class Comment < Base
  26 + end
  27 +
  28 + class Note < Base
  29 + end
  30 +
  31 + class Objekt < Base
  32 + end
  33 +
  34 + class Person < Base
  35 + def checkins
  36 + Checkin.find(:all, :from => "/people/#{login}/objects.xml", :params => {:filters => :checkins})
  37 + end
  38 +
  39 + def checkins
  40 + Note.find(:all, :from => "/people/#{login}/objects.xml", :params => {:filters => :notes})
  41 + end
  42 +
  43 + def photos
  44 + Photo.find(:all, :from => "/people/#{login}/objects.xml", :params => {:filters => :photos})
  45 + end
  46 +
  47 + def objects(options = {})
  48 + Objekt.find(:all, :from => "/people/#{login}/search.xml", :params => options)
  49 + end
  50 + end
  51 +
  52 + class Photo < Base
  53 + self.element_name = 'object'
  54 +
  55 + def comments
  56 + Comment.find(:all, :from => "/objects/#{id}/comments")
  57 + end
  58 + end
  59 +
  60 + class Place < Base
  61 + def checkins
  62 + Checkin.find(:all, :params => options.update(:project_id => id))
  63 + end
  64 + end
  65 +
  66 +end
6 spec/brightkitey_spec.rb
... ... @@ -0,0 +1,6 @@
  1 +require File.join(File.dirname(__FILE__), %w[spec_helper])
  2 +
  3 +describe Brightkitey do
  4 +end
  5 +
  6 +# EOF
15 spec/spec_helper.rb
... ... @@ -0,0 +1,15 @@
  1 +require File.expand_path(
  2 + File.join(File.dirname(__FILE__), %w[.. lib brightkitey]))
  3 +
  4 +Spec::Runner.configure do |config|
  5 + # == Mock Framework
  6 + #
  7 + # RSpec uses it's own mocking framework by default. If you prefer to
  8 + # use mocha, flexmock or RR, uncomment the appropriate line:
  9 + #
  10 + # config.mock_with :mocha
  11 + # config.mock_with :flexmock
  12 + # config.mock_with :rr
  13 +end
  14 +
  15 +# EOF

0 comments on commit 249febf

Please sign in to comment.
Something went wrong with that request. Please try again.