xupa_emec 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.idea/dictionaries/bernardo.xml +3 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +8 -0
- data/.idea/modules.xml +9 -0
- data/.idea/vcs.xml +8 -0
- data/.idea/xupa_emec.iml +63 -0
- data/bin/xupa_emec +3 -2
- data/lib/xupa_emec/crawler.rb +3 -1
- data/lib/xupa_emec/version.rb +1 -1
- data/xupa_emec.gemspec +8 -2
- metadata +10 -4
data/.idea/encodings.xml
ADDED
data/.idea/misc.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="DependencyValidationManager">
|
4
|
+
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
5
|
+
</component>
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="Ruby SDK 1.8.7-p174" project-jdk-type="RUBY_SDK" />
|
7
|
+
</project>
|
8
|
+
|
data/.idea/modules.xml
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/xupa_emec.iml" filepath="$PROJECT_DIR$/.idea/xupa_emec.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
9
|
+
|
data/.idea/vcs.xml
ADDED
data/.idea/xupa_emec.iml
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="GemRequirementsHolder" version="3">
|
4
|
+
<requirement>
|
5
|
+
<requirement>
|
6
|
+
<dependency name="activesupport" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
|
7
|
+
</requirement>
|
8
|
+
<source from="Gemfile" />
|
9
|
+
</requirement>
|
10
|
+
<requirement>
|
11
|
+
<requirement>
|
12
|
+
<dependency name="bundler" version="1.0.0" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
|
13
|
+
</requirement>
|
14
|
+
<source from="Gemfile" />
|
15
|
+
</requirement>
|
16
|
+
<requirement>
|
17
|
+
<requirement>
|
18
|
+
<dependency name="fastercsv" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
|
19
|
+
</requirement>
|
20
|
+
<source from="Gemfile" />
|
21
|
+
</requirement>
|
22
|
+
<requirement>
|
23
|
+
<requirement>
|
24
|
+
<dependency name="jeweler" version="1.5.1" bound="LATEST_IN_BRANCH" git="false" path="false" doRequire="true" />
|
25
|
+
</requirement>
|
26
|
+
<source from="Gemfile" />
|
27
|
+
</requirement>
|
28
|
+
<requirement>
|
29
|
+
<requirement>
|
30
|
+
<dependency name="mechanize" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
|
31
|
+
</requirement>
|
32
|
+
<source from="Gemfile" />
|
33
|
+
</requirement>
|
34
|
+
<requirement>
|
35
|
+
<requirement>
|
36
|
+
<dependency name="nokogiri" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
|
37
|
+
</requirement>
|
38
|
+
<source from="Gemfile" />
|
39
|
+
</requirement>
|
40
|
+
<requirement>
|
41
|
+
<requirement>
|
42
|
+
<dependency name="trollop" version="0" bound="GREATER_OR_EQUAL" git="false" path="false" doRequire="true" />
|
43
|
+
</requirement>
|
44
|
+
<source from="Gemfile" />
|
45
|
+
</requirement>
|
46
|
+
</component>
|
47
|
+
<component name="NewModuleRootManager">
|
48
|
+
<content url="file://$MODULE_DIR$" />
|
49
|
+
<orderEntry type="inheritedJdk" />
|
50
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
51
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] rake (v0.8.7, /Library/Ruby/Gems/1.8/gems/rake-0.8.7)" level="application" />
|
52
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] bundler (v1.0.0, /Library/Ruby/Gems/1.8/gems/bundler-1.0.0)" level="application" />
|
53
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] activesupport (v3.0.0, /Library/Ruby/Gems/1.8/gems/activesupport-3.0.0)" level="application" />
|
54
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] fastercsv (v1.5.3, /Library/Ruby/Gems/1.8/gems/fastercsv-1.5.3)" level="application" />
|
55
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] nokogiri (v1.4.3.1, /Users/bernardo/.bundle/ruby/1.8/gems/nokogiri-1.4.3.1)" level="application" />
|
56
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] trollop (v1.16.2, /Library/Ruby/Gems/1.8/gems/trollop-1.16.2)" level="application" />
|
57
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] jeweler (v1.5.1, /Library/Ruby/Gems/1.8/gems/jeweler-1.5.1)" level="application" />
|
58
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] mechanize (v1.0.0, /Library/Ruby/Gems/1.8/gems/mechanize-1.0.0)" level="application" />
|
59
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] nokogiri (v1.4.3.1, /Users/bernardo/.bundle/ruby/1.8/gems/nokogiri-1.4.3.1)" level="application" />
|
60
|
+
<orderEntry type="library" scope="PROVIDED" name="[gem] git (v1.2.5, /Library/Ruby/Gems/1.8/gems/git-1.2.5)" level="application" />
|
61
|
+
</component>
|
62
|
+
</module>
|
63
|
+
|
data/bin/xupa_emec
CHANGED
@@ -37,7 +37,7 @@ File.open(opts[:entrada], "r") do |input|
|
|
37
37
|
iess_to_search.each_with_index do |line, index|
|
38
38
|
|
39
39
|
raw_name = line.css('td:nth-child(2)').text.strip
|
40
|
-
ies_search_name = raw_name.split('-').max{|a,b| a.length <=> b.length } #pega o nome maior
|
40
|
+
ies_search_name = raw_name.split('-').max{|a,b| a.length <=> b.length }.strip #pega o nome maior
|
41
41
|
|
42
42
|
puts
|
43
43
|
puts "#{index+1} - Buscando nome da instituição '#{ies_search_name}'..."
|
@@ -51,7 +51,8 @@ File.open(opts[:entrada], "r") do |input|
|
|
51
51
|
out_csv << new_hash
|
52
52
|
end
|
53
53
|
else
|
54
|
-
|
54
|
+
result = crawler.crawl(ies_search_name)
|
55
|
+
out_csv << result if result
|
55
56
|
end
|
56
57
|
|
57
58
|
end
|
data/lib/xupa_emec/crawler.rb
CHANGED
@@ -18,7 +18,9 @@ module XupaEmec
|
|
18
18
|
})
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
ies_name_cell = r.search('#lista_resultado > table > tbody > tr > td')[2]
|
22
|
+
return unless ies_name_cell
|
23
|
+
ies_url = ies_name_cell.inner_html.match( /detalhamento\/(.*)\' \)/ )[1]
|
22
24
|
|
23
25
|
puts "Buscando dados de '#{ies_search_name}' em #{ies_url}..."
|
24
26
|
ies_data = agent.get("http://emec.mec.gov.br/emec/consulta-ies/index/#{ies_url}")
|
data/lib/xupa_emec/version.rb
CHANGED
data/xupa_emec.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{xupa_emec}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bernardo de P\303\241dua"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-10}
|
13
13
|
s.default_executable = %q{xupa_emec}
|
14
14
|
s.description = %q{Puxa dados sobre instituições de ensino superior do site do MEC para o formato CSV.}
|
15
15
|
s.email = %q{berpasan@gmail.com}
|
@@ -20,6 +20,12 @@ Gem::Specification.new do |s|
|
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
|
+
".idea/dictionaries/bernardo.xml",
|
24
|
+
".idea/encodings.xml",
|
25
|
+
".idea/misc.xml",
|
26
|
+
".idea/modules.xml",
|
27
|
+
".idea/vcs.xml",
|
28
|
+
".idea/xupa_emec.iml",
|
23
29
|
"Gemfile",
|
24
30
|
"Gemfile.lock",
|
25
31
|
"LICENSE.txt",
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xupa_emec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 5
|
10
|
+
version: 1.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Bernardo de P\xC3\xA1dua"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-10 00:00:00 -02:00
|
19
19
|
default_executable: xupa_emec
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -206,6 +206,12 @@ extra_rdoc_files:
|
|
206
206
|
- README.rdoc
|
207
207
|
files:
|
208
208
|
- .document
|
209
|
+
- .idea/dictionaries/bernardo.xml
|
210
|
+
- .idea/encodings.xml
|
211
|
+
- .idea/misc.xml
|
212
|
+
- .idea/modules.xml
|
213
|
+
- .idea/vcs.xml
|
214
|
+
- .idea/xupa_emec.iml
|
209
215
|
- Gemfile
|
210
216
|
- Gemfile.lock
|
211
217
|
- LICENSE.txt
|