ryc 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/lib/ryc.rb +43 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 5c83b6b8ad4091beb8d50f51456875fbb7c8230e
|
|
4
|
+
data.tar.gz: 045002ab42874b6f529b63da191b66a59c940826
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 0038ddbf38e1341ba7f8bff8be0c444f0af2a9d878832cf6ff4f3fba97f937a6d420ee4bc90c81d1c952b357ed0960d2b0b8607c9b7dd05c75d462af21300e31
|
|
7
|
+
data.tar.gz: db78ac7758452285a0cbc23b3e17b65299254b37a49e72d30410d50eeeab073214f5d6eccb34166df4079a2a483df653e16ff98dd1ca191da02a424456f97562
|
data/lib/ryc.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'nokogiri'
|
|
3
|
+
require 'open-uri'
|
|
4
|
+
|
|
5
|
+
class Ryc
|
|
6
|
+
|
|
7
|
+
def self.comment
|
|
8
|
+
begin
|
|
9
|
+
page = Nokogiri::HTML(open("http://www.randomyoutubecomment.com/"))
|
|
10
|
+
thecomment = page.css("div a p")[0].text
|
|
11
|
+
puts thecomment
|
|
12
|
+
rescue OpenURI::HTTPError
|
|
13
|
+
puts "Couldn't get the page - OpenURL::HTTPError"
|
|
14
|
+
puts "Trying again..."
|
|
15
|
+
retry
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.author
|
|
20
|
+
begin
|
|
21
|
+
page = Nokogiri::HTML(open("http://www.randomyoutubecomment.com/"))
|
|
22
|
+
theauthor = page.css("div a + p")[0].text
|
|
23
|
+
puts theauthor
|
|
24
|
+
rescue OpenURI::HTTPError
|
|
25
|
+
puts "Couldn't get the page - OpenURL::HTTPError"
|
|
26
|
+
puts "Trying again..."
|
|
27
|
+
retry
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.vidurl
|
|
32
|
+
begin
|
|
33
|
+
page = Nokogiri::HTML(open("http://www.randomyoutubecomment.com/"))
|
|
34
|
+
thevidurl = page.css("div p:nth-child(4) a")[0]["href"]
|
|
35
|
+
puts thevidurl
|
|
36
|
+
rescue OpenURI::HTTPError
|
|
37
|
+
puts "Couldn't get the page - OpenURL::HTTPError"
|
|
38
|
+
puts "Trying again..."
|
|
39
|
+
retry
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ryc
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Sean Henderson
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2013-12-25 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description: Generate random user content from the internet anywhere in your application.
|
|
14
|
+
email: mail@sean.sh
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- lib/ryc.rb
|
|
20
|
+
homepage: http://rubygems.org/gems/rytc
|
|
21
|
+
licenses:
|
|
22
|
+
- nil
|
|
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.0.3
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: Random User Comment
|
|
44
|
+
test_files: []
|