wikiconvert 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/wikiconvert +2 -0
- data/lib/wikiconvert.rb +37 -0
- data/lib/wikiconvert/methods.rb +15 -0
- data/lib/wikiconvert/version.rb +3 -0
- data/wikiconvert.gemspec +24 -0
- metadata +113 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 67c9dbd5bb22a251306a8ad5a1aa75b30a728d63
|
4
|
+
data.tar.gz: 889e77adff6da47bf8ddcfd5938b25256a8dc216
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9c933fa2a987d64abc8711edb172cff4d10557f9908a7b13b8595edcb06a146ce1c3cfb95425a611db5a7febb57bcde1ba3d0417430033e91574ddf751edd152
|
7
|
+
data.tar.gz: c29580c891db38777214d58ba5cdc01a3cb140cfa842aa765cbbd035f5ef3fd01a8bf2912ca9be727e03b7f67c9678f7498eddd203fc2369b7c3f13e3ff28583
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Josh
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
wikiconvert
|
2
|
+
===========
|
3
|
+
|
4
|
+
replacing wikipedia with legibility
|
5
|
+
|
6
|
+
wikiconvert takes [wikipedia](http://www.wikipedia.org/)
|
7
|
+
text in and outputs a thesaurus-ed response.
|
8
|
+
basically this means you can get
|
9
|
+
away with using wikipedia even though you have
|
10
|
+
absolutely no idea what the hell any of the words mean
|
11
|
+
|
12
|
+
becuase i'd rather not get in trouble
|
13
|
+
-------------------------------------
|
14
|
+
|
15
|
+
don't use wikiconvert to get away with using wikipedia
|
16
|
+
even though you have absolutely no idea what the hell
|
17
|
+
any of the words mean
|
18
|
+
|
19
|
+
and on to the usage
|
20
|
+
-------------------
|
21
|
+
|
22
|
+
```bash
|
23
|
+
$ gem install wikiconvert #install wikiconvert with rubygems
|
24
|
+
```
|
25
|
+
|
26
|
+
then, you'll need an API key, which you can
|
27
|
+
get from http://words.bighugelabs.com/getkey.php
|
28
|
+
|
29
|
+
now you can use wikiconvert for its actual purpose
|
30
|
+
--------------------------------------------------
|
31
|
+
|
32
|
+
now run the wikiconvert executable with the parameters you want to convert
|
33
|
+
|
34
|
+
```bash
|
35
|
+
$ wikiconvert 'words in a sentence'
|
36
|
+
```
|
data/Rakefile
ADDED
data/bin/wikiconvert
ADDED
data/lib/wikiconvert.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'wikiconvert/version'
|
2
|
+
require_relative 'wikiconvert/methods'
|
3
|
+
require 'rainbow'
|
4
|
+
require 'dinosaurus'
|
5
|
+
|
6
|
+
module Wikiconvert
|
7
|
+
|
8
|
+
#edit this
|
9
|
+
Dinosaurus.configure do |config|
|
10
|
+
config.api_key = File.read(bighugelabs_api.txt) #read the api key
|
11
|
+
end
|
12
|
+
|
13
|
+
cls
|
14
|
+
|
15
|
+
# ACTUAL CODE
|
16
|
+
input = ARGV[0]
|
17
|
+
|
18
|
+
if input.nil?
|
19
|
+
puts 'You have not specified any arguments'
|
20
|
+
Process.exit(0)
|
21
|
+
end
|
22
|
+
|
23
|
+
split = input.split(" ")
|
24
|
+
|
25
|
+
split.length.times do |i|
|
26
|
+
results = Dinosaurus.synonyms_of(split[i])
|
27
|
+
unless split[i].nil?
|
28
|
+
replace_in_array(split, split[i], results[i])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
cls
|
33
|
+
final = array_to_string(split)
|
34
|
+
puts ">> #{final}"
|
35
|
+
|
36
|
+
lots_of_space
|
37
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
def cls
|
2
|
+
system('clear')
|
3
|
+
end
|
4
|
+
|
5
|
+
def array_to_string(x)
|
6
|
+
x.join(",").gsub! ",", " "
|
7
|
+
end
|
8
|
+
|
9
|
+
def lots_of_space
|
10
|
+
10.times { puts }
|
11
|
+
end
|
12
|
+
|
13
|
+
def replace_in_array(array, replace, with)
|
14
|
+
array.collect! { |element| (element == replace) ? with : element }
|
15
|
+
end
|
data/wikiconvert.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../lib/wikiconvert/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "wikiconvert"
|
6
|
+
spec.version = Wikiconvert::VERSION
|
7
|
+
spec.authors = ["Josh"]
|
8
|
+
spec.email = ["joshception@icloud.com"]
|
9
|
+
spec.summary = %q{replacing wikipedia with legibility}
|
10
|
+
spec.description = %q{wikiconvert takes wikipedia text in and
|
11
|
+
outputs a thesaurus-ed response.}
|
12
|
+
spec.homepage = ""
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
21
|
+
spec.add_development_dependency "rake"
|
22
|
+
spec.add_dependency 'dinosaurus'
|
23
|
+
spec.add_dependency 'rainbow'
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wikiconvert
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.2'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Josh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-06-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dinosaurus
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rainbow
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: |-
|
70
|
+
wikiconvert takes wikipedia text in and
|
71
|
+
outputs a thesaurus-ed response.
|
72
|
+
email:
|
73
|
+
- joshception@icloud.com
|
74
|
+
executables:
|
75
|
+
- wikiconvert
|
76
|
+
extensions: []
|
77
|
+
extra_rdoc_files: []
|
78
|
+
files:
|
79
|
+
- ".gitignore"
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/wikiconvert
|
85
|
+
- lib/wikiconvert.rb
|
86
|
+
- lib/wikiconvert/methods.rb
|
87
|
+
- lib/wikiconvert/version.rb
|
88
|
+
- wikiconvert.gemspec
|
89
|
+
homepage: ''
|
90
|
+
licenses:
|
91
|
+
- MIT
|
92
|
+
metadata: {}
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubyforge_project:
|
109
|
+
rubygems_version: 2.3.0
|
110
|
+
signing_key:
|
111
|
+
specification_version: 4
|
112
|
+
summary: replacing wikipedia with legibility
|
113
|
+
test_files: []
|