rinkusukurepa 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 +33 -32
- data/lib/rinkusukurepa/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: 9d08b3e1c02c50120b9b2839260164be3f68513e
|
4
|
+
data.tar.gz: 65f03d50228c55bb84804b4423532125f961d792
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba4a4eecee0b5b0de8ca7a2ba983901f01078dd32d2b0dcc68bbf5e25533df5c72ad947c4d6c29a2edafed25b34bcc0fe6a545291746451c1159d8f7014155f8
|
7
|
+
data.tar.gz: 41f488ae05bc50e8ae4ed4d0d288a40e38fcf4431cef327860ce97b928c8700490de02fafb4a46bd1edb6eb1a4c61c2b2ec6051ba82477f00ee9d60ca1ca9fb7
|
data/README.md
CHANGED
@@ -19,38 +19,39 @@ Or install it yourself as:
|
|
19
19
|
$ gem install rinkusukurepa
|
20
20
|
|
21
21
|
## Usage
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
22
|
+
|
23
|
+
web_page = Rinkusukurepa.parse_url!('https://github.com/rewin0087/rinkusukurepa')
|
24
|
+
web_page.title # return the web page title
|
25
|
+
web_page.description # return the web page description
|
26
|
+
web_page.images # return all the web page images
|
27
|
+
web_page.site_name # return site name
|
28
|
+
web_page.video # return video if present
|
29
|
+
web_page.page_type # return page type
|
30
|
+
web_page.page_document # return raw nokigiri document object
|
31
|
+
web_page.attributes # return a hash with icon, title, description, images, site_name, video and page_type
|
32
|
+
|
33
|
+
Scrape and get specific attribute
|
34
|
+
|
35
|
+
web_page = Rinkusukurepa.new('https://github.com/rewin0087/rinkusukurepa')
|
36
|
+
web_page.parse_url # it will scrape and return the document of the url
|
37
|
+
web_page.get_icon # it will find the icon from the document and return the icon (@icon is now set)
|
38
|
+
web_page.get_title # it will find the title from the document and return the title (@title is now set)
|
39
|
+
web_page.get_description # it will find the description from the document and return the description (@description is now set)
|
40
|
+
web_page.get_images # it will find the images from the document and return the images (@images are now set)
|
41
|
+
web_page.get_site_name # it will find the site name from the document and return the site name (@site_name is now set)
|
42
|
+
web_page.get_video # it will find the video from the document and return the video (@video is now set)
|
43
|
+
web_page.get_page_type # it will find the page type from the document and return the page type (@page_type is now set)
|
44
|
+
|
45
|
+
To customize some of the configurations
|
46
|
+
create a file in the config/initializers/rinkusukurepa.rb
|
47
|
+
and put:
|
48
|
+
Rinkusukurepa.configure do |config|
|
49
|
+
config.image_min_width = 200 # default 150
|
50
|
+
config.image_min_height = 200 # default 100
|
51
|
+
config.max_image = 20 # default 20
|
52
|
+
config.page_types = ['article', 'post'] # default ['website', 'video', 'sound']
|
53
|
+
config.image_extensions = /(.png|.jpg)/ # default /(.png|PNG|.jpg|JPG|.jpeg|JPEG|BMP|.bmp|.gif|GIF)/
|
54
|
+
end
|
54
55
|
|
55
56
|
## Contributing
|
56
57
|
|