reddinfo 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/reddinfo.rb +20 -0
  3. metadata +45 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: aeba5d441569b48a3dcb477159516b2caf64b14a
4
+ data.tar.gz: 77e83be629e704db2ec6ea321724d269650344ac
5
+ SHA512:
6
+ metadata.gz: 0751b4cf368d887332e26748a9caab1ca5820b8718746f7ca8e6e875bc011c53caf7641462bbcbff1663a9ca69b562112eb84e1a9d051320fc86ee90d8df43ce
7
+ data.tar.gz: b305702a5d5c9de0cf298f018186d6590166de8a41da18bca0614a1db95387810724a3e3f7902d5234925a0e16b1763a21a14b0f559043c336339b4391d34346
data/lib/reddinfo.rb ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ require 'net/http'
3
+ require 'uri'
4
+ require 'JSON'
5
+
6
+ # Main Treehouse Class
7
+ class Reddit
8
+ def self.subreddit(subreddit)
9
+ json = Net::HTTP.get(URI.parse('http://reddit.com' + '/r/' + subreddit + '/.json'))
10
+ JSON.parse(json)
11
+ end
12
+ def self.user(user)
13
+ json = Net::HTTP.get(URI.parse('http://reddit.com' + '/u/' + user + '/.json'))
14
+ JSON.parse(json)
15
+ end
16
+ def self.front
17
+ json = Net::HTTP.get(URI.parse('http://reddit.com/.json'))
18
+ JSON.parse(json)
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: reddinfo
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.0'
5
+ platform: ruby
6
+ authors:
7
+ - Josh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Return a hash of objects from different things on Reddit
14
+ email: joshception@icloud.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/reddinfo.rb
20
+ homepage: http://rubygems.org/gems/reddinfo
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.2.2
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Get information on Reddit things
44
+ test_files: []
45
+ has_rdoc: