giphy-noah 0.0.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.
- checksums.yaml +7 -0
- data/bin/giphy +5 -0
- data/lib/giphy.rb +18 -0
- metadata +45 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: b059eba841d0ca182885166d150e826d4fa89f6c
|
|
4
|
+
data.tar.gz: b5936c6eaeb50e2c094338a266a8693f00ca5fde
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 30f7f4ae5689f68b88057e1e3ccca212eaa2626d41e77641d0c2e813759315ac8d4448f3b8e27e9c88c5a22eb9504d99b5f31abc0288ac3850eebd3b3c780230
|
|
7
|
+
data.tar.gz: 2fe06ae4f83eefc0a6112aac7889e17abb5429ae117648169e71445767c9b48beb57301eb191371353000e23dabe395b0b945ad2cc17573c57a47559f29e18e3
|
data/bin/giphy
ADDED
data/lib/giphy.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
require 'httparty'
|
|
2
|
+
|
|
3
|
+
class Giphy
|
|
4
|
+
def self.search keyword
|
|
5
|
+
endpoint = "http://api.giphy.com/v1/gifs/search?q=#{keyword}&api_key=dc6zaTOxFJmzC"
|
|
6
|
+
data = HTTParty.get(endpoint)['data']
|
|
7
|
+
gif_urls = []
|
|
8
|
+
data.each do |gif|
|
|
9
|
+
gif_urls << gif['images']['original']['url']
|
|
10
|
+
end
|
|
11
|
+
return gif_urls
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.random keyword
|
|
15
|
+
endpoint = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=#{keyword}"
|
|
16
|
+
return HTTParty.get(endpoint)['data']['image_original_url']
|
|
17
|
+
end
|
|
18
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: giphy-noah
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Noah Levine
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
executables:
|
|
16
|
+
- giphy
|
|
17
|
+
extensions: []
|
|
18
|
+
extra_rdoc_files: []
|
|
19
|
+
files:
|
|
20
|
+
- bin/giphy
|
|
21
|
+
- lib/giphy.rb
|
|
22
|
+
homepage:
|
|
23
|
+
licenses: []
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubyforge_project:
|
|
41
|
+
rubygems_version: 2.4.6
|
|
42
|
+
signing_key:
|
|
43
|
+
specification_version: 4
|
|
44
|
+
summary: gives helper methods for giphy api
|
|
45
|
+
test_files: []
|