instagramjs-rails 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ OWFiOGVhMWE1OGQzNjQzOWQzYWEyZDVkNWVlMDczODJkMThhZmM2Yw==
5
+ data.tar.gz: !binary |-
6
+ NmViMmY1OGQzZmY3YjY0ZTg1NWIzMjg1NzI5OWEwYWVjNWZhYWQxNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MGMzN2JjZDE1YmQ5ZDI1NDViMjFmNjVjY2E0OWNiNDM1YmRmMTRhNjJmNDIy
10
+ NWI1M2NiM2M4NGE5ZDhlYmFiYTE5OGFlMWE1ZmJlZTlkODIxYTk5ZTMyNDcx
11
+ NzMwZDJlNmEzZDM0ODA5YzE0ZDA4NTU1ZjA1ZDMwNGY4ODI5NTg=
12
+ data.tar.gz: !binary |-
13
+ NTRiOGFkY2E4MmFiM2QxZjQzNDYxMDBjNTgxZjY3ZDMwZTAwNGVmZDIyYjg2
14
+ NWEyZmM4YTIyY2U4ZjkyYjE1MjhkMDgwMDEzOTBmYmJkZTE5ODE4ODdjMmIz
15
+ MWZiNGY4MjRjMzcyNDI2OTBmNTI4OTUyNGIwOTU0ODVmYTczMTQ=
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Ilya Bodrov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # Instagram.js plugin for Rails
2
+
3
+ A ruby gem that uses the Rails asset pipeline to include the the Instagram.js plugin by Giovanni Cappellotto:
4
+
5
+ * Homepage: http://potomak.github.com/jquery-instagram
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'instagramjs-rails'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install instagramjs-rails
20
+
21
+ NOTE: this is a jQuery plugin so you will also need the `jquery-rails` gem:
22
+
23
+ * https://github.com/rails/jquery-rails
24
+
25
+ ## Usage
26
+
27
+ In your `application.js` you will need to add this line:
28
+
29
+ //= require jquery.instagram
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
@@ -0,0 +1,8 @@
1
+ require "instagramjs-rails/version"
2
+
3
+ module InstagramJS
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module InstagramJS
2
+ module Rails
3
+ VERSION = "0.3.0"
4
+ end
5
+ end
@@ -0,0 +1,78 @@
1
+ /*! jQuery Instagram - v0.3.0 - 2013-08-10
2
+ * http://potomak.github.com/jquery-instagram
3
+ * Copyright (c) 2013 Giovanni Cappellotto; Licensed MIT */
4
+ (function($) {
5
+
6
+ function composeRequest(options) {
7
+ var url = 'https://api.instagram.com/v1';
8
+ var data = {};
9
+
10
+ if (options.accessToken == null && options.clientId == null) {
11
+ throw 'You must provide an access token or a client id';
12
+ }
13
+
14
+ data = $.extend(data, {
15
+ access_token: options.accessToken,
16
+ client_id: options.clientId,
17
+ count: options.count
18
+ });
19
+
20
+ if (options.url != null) {
21
+ url = options.url;
22
+ }
23
+ else if (options.hash != null) {
24
+ url += '/tags/' + options.hash + '/media/recent';
25
+ }
26
+ else if (options.search != null) {
27
+ url += '/media/search';
28
+ data = $.extend(data, options.search);
29
+ }
30
+ else if (options.userId != null) {
31
+ if (options.accessToken == null) {
32
+ throw 'You must provide an access token';
33
+ }
34
+ url += '/users/' + options.userId + '/media/recent';
35
+ }
36
+ else if (options.location != null) {
37
+ url += '/locations/' + options.location.id + '/media/recent';
38
+ delete options.location.id;
39
+ data = $.extend(data, options.location);
40
+ }
41
+ else {
42
+ url += '/media/popular';
43
+ }
44
+
45
+ return {url: url, data: data};
46
+ }
47
+
48
+ $.fn.instagram = function(options) {
49
+ var that = this;
50
+ options = $.extend({}, $.fn.instagram.defaults, options);
51
+ var request = composeRequest(options);
52
+
53
+ $.ajax({
54
+ dataType: "jsonp",
55
+ url: request.url,
56
+ data: request.data,
57
+ success: function(response) {
58
+ that.trigger('didLoadInstagram', response);
59
+ }
60
+ });
61
+
62
+ this.trigger('willLoadInstagram', options);
63
+
64
+ return this;
65
+ };
66
+
67
+ $.fn.instagram.defaults = {
68
+ accessToken: null,
69
+ clientId: null,
70
+ count: null,
71
+ url: null,
72
+ hash: null,
73
+ userId: null,
74
+ location: null,
75
+ search: null
76
+ };
77
+
78
+ }(jQuery));
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: instagramjs-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - Ilya Bodrov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ description: ! 'A ruby gem that uses the Rails asset pipeline to include the Instagram.js
28
+
29
+ plugin by Giovanni Cappellotto.'
30
+ email:
31
+ - golosizpru@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - lib/instagramjs-rails/version.rb
37
+ - lib/instagramjs-rails.rb
38
+ - vendor/assets/javascripts/jquery.instagram.js
39
+ - LICENSE
40
+ - README.md
41
+ homepage: https://github.com/bodrovis/instagramjs-rails
42
+ licenses: []
43
+ metadata: {}
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 2.0.7
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: Includes javascript and css files for the Instagram.js.
64
+ test_files: []