frinkiac 0.0.4 → 0.0.5
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 +22 -20
- data/frinkiac.gemspec +1 -1
- data/lib/frinkiac/version.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 020f4e9f5bb8acd2161a58911384c7683cb2d8a0
|
4
|
+
data.tar.gz: 2862811574faf14083cf0721c658bbaaae54f253
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0814758e2d22f021277858ca46de1552bd8140da59fbe5ea8bdbabfa488c643ae057945687e76e0ce3b41e89b423767a1986a5fb27483430103302a86a452fd
|
7
|
+
data.tar.gz: 41f41b1e382cb9974b27ecdc1b018a46c46b79b5abc33c1829069c529e9fb37c840d40b781a47edd126edcec632783d24f5046856651590ff5c686a1da2933cd
|
data/README.md
CHANGED
@@ -1,56 +1,58 @@
|
|
1
1
|
# Frinkiac
|
2
2
|
|
3
|
-
A ruby wrapper to interact with Frinkiac.com API based Ben Lewis's post: [Wrapping Your API In A Custom Ruby Gem](https://blog.engineyard.com/2014/wrapping-your-api-in-a-ruby-gem).
|
3
|
+
A ruby wrapper to interact with Frinkiac.com API based on Ben Lewis's post: [Wrapping Your API In A Custom Ruby Gem](https://blog.engineyard.com/2014/wrapping-your-api-in-a-ruby-gem).
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'frinkiac', '~> 0.0.
|
10
|
+
gem 'frinkiac', '~> 0.0.4'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
14
14
|
|
15
|
-
$ bundle
|
15
|
+
$ bundle install
|
16
16
|
|
17
17
|
Or install it yourself as:
|
18
18
|
|
19
|
-
$ gem install frinkiac
|
19
|
+
$ gem install frinkiac -v 0.0.4
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
There are a couple ways to get screencaps from the Frinkiac API through this gem.
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
You can also get the ```caption``` from the image, as well as the ```meme_url```, which returns the caption overlaid on top of the image.
|
28
|
-
|
29
|
-
You can also specify your own caption for the meme URL like so:
|
25
|
+
You can get an array of screencaps that match a specific search term:
|
30
26
|
|
31
27
|
```
|
32
|
-
|
28
|
+
Frinkiac::Screencap.search('lazy saturday')
|
33
29
|
```
|
34
30
|
|
35
|
-
|
31
|
+
|
32
|
+
And you can get a random screencap from the aforementioned array of screencaps:
|
36
33
|
|
37
34
|
```
|
38
|
-
|
35
|
+
Frinkiac::Screencap.random('lazy saturday')
|
39
36
|
```
|
40
37
|
|
41
|
-
|
38
|
+
After getting a screencap object, you now have easy access to the attributes: ```id```, ```episode``` and ```timestamp```.
|
42
39
|
|
43
|
-
|
40
|
+
The ```Frinkiac::Screencap``` object also gives you access to some helper methods to make your life easier.
|
44
41
|
|
45
|
-
```
|
46
|
-
Frinkiac::Screencap.search('lazy saturday')
|
47
|
-
```
|
42
|
+
There's the ```image_url``` method that returns a valid image url based on the episode and timestamp information returned by the API.
|
48
43
|
|
44
|
+
The ```caption``` method hits the API's caption endpoint and returns a string of the original screencap's caption.
|
49
45
|
|
50
|
-
And
|
46
|
+
And finally, there's the ```meme_url```. When used without params, this returns the original caption overlaid on top of the image.
|
47
|
+
|
48
|
+
You can also customize the image by overlaying your own captions on top of the image like so:
|
51
49
|
|
52
50
|
```
|
53
|
-
|
51
|
+
screencap.meme_url("I love those lazy Saturdays")
|
52
|
+
```
|
53
|
+
Or multiple lines of text like so:
|
54
|
+
```
|
55
|
+
screencap.meme_url(["I love those lazy Saturdays", "Unlike that fake Saturday that almost got me fired"])
|
54
56
|
```
|
55
57
|
|
56
58
|
## Development
|
data/frinkiac.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "frinkiac"
|
8
8
|
spec.version = Frinkiac::VERSION
|
9
9
|
spec.authors = ['Cesar Camacho']
|
10
|
-
spec.email = ['
|
10
|
+
spec.email = ['chanko@gmail.com']
|
11
11
|
|
12
12
|
spec.summary = %q{Gem to wrap Frinkiac.com API}
|
13
13
|
spec.description = %q{Gem to wrap Frinkiac.com API}
|
data/lib/frinkiac/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frinkiac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cesar Camacho
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -138,7 +138,7 @@ dependencies:
|
|
138
138
|
version: 1.0.0
|
139
139
|
description: Gem to wrap Frinkiac.com API
|
140
140
|
email:
|
141
|
-
-
|
141
|
+
- chanko@gmail.com
|
142
142
|
executables: []
|
143
143
|
extensions: []
|
144
144
|
extra_rdoc_files: []
|
@@ -175,9 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
177
|
rubyforge_project:
|
178
|
-
rubygems_version: 2.
|
178
|
+
rubygems_version: 2.6.12
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Gem to wrap Frinkiac.com API
|
182
182
|
test_files: []
|
183
|
-
has_rdoc:
|