simple_wiki_converter 0.1.1 → 0.1.3
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 +8 -0
- data/lib/simple_wiki_converter/version.rb +1 -1
- data/lib/simple_wiki_converter.rb +20 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbcf38739fe0ed95426c46edde79fb6633c0c019fc1a82d200a1cc1cf7802be1
|
4
|
+
data.tar.gz: a2738b3a67ad8f8d7cfa0bf67553333081aaaf7fa49e6f9daf2d7a73a0c2e3db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc9c47da849e63347219f43523b4c68e8cf0455d0da378027cc6394bb4bff45a8dbf01a3abbdafea4c4cb104d9da1c7c6c58c192273f1adb2b86de558c5f2a4
|
7
|
+
data.tar.gz: 3bbd1e1db5c04ecc34be0f11a692187a5d74e9d9eab903e0a38e2d4d29b42af970e819db3fe587e61a6ca88abcfab951a294ee3b84d8063c80ba4f29691a730c
|
data/README.md
CHANGED
@@ -7,6 +7,14 @@ Wikipedia articles are infamous for being heavily referenced. One article could
|
|
7
7
|
|
8
8
|
## Installation
|
9
9
|
|
10
|
+
$ gem install simple_wiki_converter
|
11
|
+
|
12
|
+
$ require 'simple_wiki_converter'
|
13
|
+
|
14
|
+
$ scraper = SimpleWikiConverter::WikiScraper.new("enter-url-here")
|
15
|
+
|
16
|
+
$ puts scraper.scrape
|
17
|
+
|
10
18
|
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
11
19
|
|
12
20
|
Install the gem and add to the application's Gemfile by executing:
|
@@ -36,17 +36,26 @@ module SimpleWikiConverter
|
|
36
36
|
end
|
37
37
|
|
38
38
|
|
39
|
-
if __FILE__ == $0
|
40
|
-
def main
|
41
|
-
if ARGV.empty?
|
42
|
-
puts "Usage: simple_wiki_converter URL"
|
43
|
-
exit
|
44
|
-
end
|
45
39
|
|
46
|
-
|
47
|
-
|
48
|
-
puts
|
40
|
+
def main
|
41
|
+
if ARGV.empty?
|
42
|
+
puts "Usage: simple_wiki_converter URL"
|
43
|
+
exit
|
49
44
|
end
|
50
45
|
|
51
|
-
|
52
|
-
|
46
|
+
url = ARGV[0]
|
47
|
+
scraper = SimpleWikiConverter::WikiScraper.new(url)
|
48
|
+
scraped_content = scraper.scrape
|
49
|
+
|
50
|
+
# Define the filename
|
51
|
+
filename = "scraped_content.txt"
|
52
|
+
|
53
|
+
# Write to the file
|
54
|
+
File.open(filename, "w") do |file|
|
55
|
+
file.write(scraped_content)
|
56
|
+
end
|
57
|
+
|
58
|
+
puts "Scraped content saved to #{filename}"
|
59
|
+
end
|
60
|
+
|
61
|
+
main if __FILE__ == $0
|