ikbis 0.2.0

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.
@@ -0,0 +1,12 @@
1
+ $:.unshift(File.dirname(__FILE__))
2
+ require 'simple/base'
3
+ require 'simple/channel'
4
+ require 'simple/video'
5
+ require 'simple/photo'
6
+ require 'simple/user'
7
+
8
+ module Ikbis
9
+ module Simple
10
+
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ module Ikbis
2
+ module Simple
3
+ class Base
4
+ include HTTParty
5
+ base_uri 'ikbis.com/api'
6
+ #base_uri 'localhost:3000/api'
7
+ # TODO: Format options
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,21 @@
1
+ module Ikbis
2
+ module Simple
3
+
4
+ class Channel < Ikbis::Simple::Base
5
+
6
+ base_uri "#{Base.base_uri}/channels"
7
+
8
+ def self.info(id, response='xml')
9
+ get("/#{id}.#{response}")
10
+ end
11
+
12
+ def self.videos(id, response='xml', page=1)
13
+ get("/#{id}/videos.#{response}?page=#{page}")
14
+ end
15
+
16
+ def self.subscribers(id, response='xml')
17
+ get("/#{id}/subscribers.#{response}")
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ module Ikbis
2
+ module Simple
3
+ class Photo < Ikbis::Simple::Base
4
+
5
+ base_uri "#{Base.base_uri}/medias"
6
+
7
+ def self.info(id, response='xml')
8
+ get("/#{id}/#{response}")
9
+ end
10
+
11
+ def self.comments(id, response='xml')
12
+ get("/#{id}/comments.#{response}")
13
+ end
14
+
15
+ def self.in_category(id, response='xml', page=1)
16
+ get("/#{id}/category_medias.#{response}?page=#{page}&type=Photo")
17
+ end
18
+
19
+ def self.has_tag(tag, response='xml', page=1)
20
+ get("#{Base.base_uri}/search/#{tag}/tags.#{response}?page=#{page}&type=Photo")
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,49 @@
1
+ module Ikbis
2
+ module Simple
3
+
4
+ class User < Ikbis::Simple::Base
5
+
6
+ base_uri "#{Base.base_uri}/users"
7
+
8
+ def self.info(id, response='xml')
9
+ get("/#{id}.#{response}")
10
+ end
11
+
12
+ def self.videos(id, response='xml', page=1)
13
+ get("/#{id}/videos.#{response}?page=#{page}")
14
+ end
15
+
16
+ def self.photos(id, response='xml', page=1)
17
+ get("/#{id}/photos.#{response}?page=#{page}")
18
+ end
19
+
20
+ def self.medias(id, response='xml', page=1)
21
+ get("/#{id}/medias.#{response}?page=#{page}")
22
+ end
23
+
24
+ def self.favorites(id, response='xml', page=1)
25
+ get("/#{id}/favorites.#{response}?page=#{page}")
26
+ end
27
+
28
+ def self.albums(id, response='xml', page=1)
29
+ get("/#{id}/albums.#{response}?page=#{page}")
30
+ end
31
+
32
+ def self.channels(id, response='xml', page=1)
33
+ get("/#{id}/channels.#{response}?page=#{page}")
34
+ end
35
+
36
+ def self.contacts(id, response='xml', page=1)
37
+ get("/#{id}/contacts.#{response}?page=#{page}")
38
+ end
39
+
40
+ # this seems to be deprecated in api_2, there is no corresponding
41
+ # contacts_medias action defined for users ... disabling this
42
+ # by: ahmad@ikbis
43
+
44
+ #def self.contacts_medias(id, response='xml', page=1)
45
+ #get("/#{id}/contacts_medias.#{response}?page=#{page}")
46
+ #end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,25 @@
1
+ module Ikbis
2
+ module Simple
3
+
4
+ class Video < Ikbis::Simple::Base
5
+
6
+ base_uri "#{Base.base_uri}/medias"
7
+
8
+ def self.info(id, response='xml')
9
+ get("/#{id}.#{response}")
10
+ end
11
+
12
+ def self.comments(id, response='xml')
13
+ get("/#{id}/comments.#{response}")
14
+ end
15
+
16
+ def self.in_category(id, response='xml', page=1)
17
+ get("/#{id}/category_medias.#{response}?page=#{page}&type=Video")
18
+ end
19
+
20
+ def self.has_tag(tag, response='xml', page=1)
21
+ get("#{Base.base_uri}/search/#{tag}/tags.#{response}?page=#{page}&type=Video")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/test_helper'
2
+
3
+ class IkbisTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+ require 'mocha'
5
+
6
+ class Test::Unit::TestCase
7
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ikbis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Moski Doski
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-14 00:00:00 +02:00
13
+ default_executable: ikbis-auth
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: multipart-post
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "1.0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: httparty
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.5.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: oauth
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.3.6
44
+ version:
45
+ description: This gem implements a full-featured ruby interface for the Ikbis API.
46
+ email: abushaikh@gmail.com
47
+ executables:
48
+ - ikbis-auth
49
+ extensions: []
50
+
51
+ extra_rdoc_files:
52
+ - LICENSE
53
+ - README
54
+ - README.markdown
55
+ files:
56
+ - .gitignore
57
+ - LICENSE
58
+ - README
59
+ - README.markdown
60
+ - Rakefile
61
+ - VERSION.yml
62
+ - bin/ikbis-auth
63
+ - lib/ikbis.rb
64
+ - lib/ikbis/advanced.rb
65
+ - lib/ikbis/advanced/base.rb
66
+ - lib/ikbis/advanced/media.rb
67
+ - lib/ikbis/advanced/photo.rb
68
+ - lib/ikbis/advanced/test.rb
69
+ - lib/ikbis/advanced/upload.rb
70
+ - lib/ikbis/advanced/video.rb
71
+ - lib/ikbis/simple.rb
72
+ - lib/ikbis/simple/base.rb
73
+ - lib/ikbis/simple/channel.rb
74
+ - lib/ikbis/simple/photo.rb
75
+ - lib/ikbis/simple/user.rb
76
+ - lib/ikbis/simple/video.rb
77
+ - test/ikbis_test.rb
78
+ - test/test_helper.rb
79
+ has_rdoc: true
80
+ homepage: http://github.com/moski/ikbis
81
+ licenses: []
82
+
83
+ post_install_message:
84
+ rdoc_options:
85
+ - --charset=UTF-8
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: "0"
93
+ version:
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">="
97
+ - !ruby/object:Gem::Version
98
+ version: "0"
99
+ version:
100
+ requirements: []
101
+
102
+ rubyforge_project:
103
+ rubygems_version: 1.3.5
104
+ signing_key:
105
+ specification_version: 3
106
+ summary: This gem implements a full-featured ruby interface for the Ikbis API.
107
+ test_files:
108
+ - test/ikbis_test.rb
109
+ - test/test_helper.rb