wreddit 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +31 -0
- data/lib/wreddit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 113fa2a253b67c27554640143b156bdfe3fe3b22
|
4
|
+
data.tar.gz: bed896e7d76e72df2be471b05f53bded122a5b49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d71eb9f7d63b148e8317f5493db4d7756d07ffe88fc6ca8e15c0d0ae970112801bad5a8ab89c37a1739b090761741462a48be4dd6361a08a510245dfb4136c3
|
7
|
+
data.tar.gz: 7f70ecc0c057a26e8b4004c76e81b1a287a44fc68cfd8efdef19f720468e5b7b9ff1c06ea3a079ee153063ccb8d5b64cd2f5606113954989f01b09be7ce52bf5
|
data/README.md
CHANGED
@@ -3,3 +3,34 @@ WReddit: Reddit API wrapper for Ruby
|
|
3
3
|
=======
|
4
4
|
# wreddit
|
5
5
|
A Reddit API Wrapper built in Ruby to play with my own Gem. It really only helps you grab subreddit information and user information.
|
6
|
+
|
7
|
+
##### What makes this special?
|
8
|
+
It's utilizing Reddit's free API resources. You can't make a lot of requests, but if you cache them using Redis, you could probably use this on a small toy app for yourself. It's a good way to quickly grab Reddit subreddits, comments, articles, and user profiles for your application.
|
9
|
+
|
10
|
+
## Install
|
11
|
+
add this to your Gemfile:
|
12
|
+
```
|
13
|
+
gem 'wreddit'
|
14
|
+
```
|
15
|
+
|
16
|
+
run ```bundle install``` in your app
|
17
|
+
|
18
|
+
## How to use
|
19
|
+
###### Reserved Keywords
|
20
|
+
<b>User, Subreddit, Comments, Title, Parser</b>
|
21
|
+
<br>Yes, I realize that this would be inconvenient in a real-world application. This is simply my own project that taught me basic API wrapping skills. In the future, I will likely update everything including the lack of a Class to help OOP
|
22
|
+
###### Example of basic usage
|
23
|
+
```
|
24
|
+
@reddit_user = user('username').parser
|
25
|
+
```
|
26
|
+
user -> checks for a username on Reddit.com. If the user doesn't exist, their API handles that.
|
27
|
+
parser -> will parse the response in JSON format by default. If you'd like to parse XML or HTTP, you can do that like this:
|
28
|
+
```
|
29
|
+
...parser('xml') or parser('html')
|
30
|
+
```
|
31
|
+
|
32
|
+
###### Example of advanced usage
|
33
|
+
In this example, we'd be grabbing the subreddit, its comments in a specific thread
|
34
|
+
```
|
35
|
+
@reddit_comment = subreddit('learnprogramming').comments('specific_article_id').parser
|
36
|
+
```
|
data/lib/wreddit/version.rb
CHANGED