Skip to content

Commit

Permalink
Reorganization of files and cleanup, data yaml is flattened, version
Browse files Browse the repository at this point in the history
bump
  • Loading branch information
armahillo committed Aug 22, 2020
1 parent b7b30d5 commit 94156e2
Show file tree
Hide file tree
Showing 8 changed files with 9,084 additions and 9,149 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

N.B. until it hits 1.0 do not make any expectations about API consistency! (SemVer says it's OK so nyah!)

## [0.2.2] - 2020-08-22

- Some reorganization of files, and cleanup
- Fixes the YAML data so that it doesn't use categories


## [0.2.1] - 2020-08-22

Emoji are now categorized, and flattened during `emoji_sub`. Some additional parsing logic exists to take generated YML from emoji spec (versioned!) and convert it into the serialized YML used by the script.

### Added

- `EmojiYamlParsr` (available for development use only)
- Versioned Emoji YMLs


## [0.2.0] - 2020-08-22

Last night I wrote a script to scrape down all the emoji definitions w/ shortcodes from emojipedia. I refined it, added specs, and created a rake task for it.
Expand All @@ -24,5 +42,6 @@ emoji HTML entities (hex-unicode) for slack shortcut format (:this_kind:)
- data/emoji.yml file,
- Specs covering basic funcitonality

[0.2.1]: https://github.com/armahillo/emoji_sub/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/armahillo/emoji_sub/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/armahillo/emoji_sub/releases/tag/v0.1.0
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ gem "rspec", "~> 3.0"
gem 'mechanize'

# For testing with mechanize. The @chrisk fork updates it
gem 'fakeweb', git: 'https://github.com/chrisk/fakeweb.git'
gem 'fakeweb', git: 'https://github.com/chrisk/fakeweb.git'
gem 'pry'
gem 'binding_of_caller'
12 changes: 11 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ GIT
PATH
remote: .
specs:
emoji_sub (0.2.1)
emoji_sub (0.2.2)

GEM
remote: https://rubygems.org/
specs:
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
coderay (1.1.3)
connection_pool (2.2.3)
debug_inspector (0.0.3)
diff-lcs (1.4.4)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
Expand All @@ -27,6 +31,7 @@ GEM
nokogiri (~> 1.6)
ntlm-http (~> 0.1, >= 0.1.1)
webrobots (>= 0.0.9, < 0.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
Expand All @@ -37,6 +42,9 @@ GEM
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
ntlm-http (0.1.1)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
rake (12.3.3)
rspec (3.9.0)
rspec-core (~> 3.9.0)
Expand All @@ -60,9 +68,11 @@ PLATFORMS
ruby

DEPENDENCIES
binding_of_caller
emoji_sub!
fakeweb!
mechanize
pry
rake (~> 12.0)
rspec (~> 3.0)

Expand Down
22 changes: 8 additions & 14 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ RSpec::Core::RakeTask.new(:spec)

task :default => :spec

namespace :data do
desc "Compile an Emoji Spec into the flattened YML"
task :load_spec do
require 'development/emoji_yaml_parsr'
EmojiYamlParsr.update_data
end
end

namespace :scrape do

desc "Pull down all emoji into YML files (long execution: 3-4 hours)"
Expand All @@ -17,18 +25,4 @@ namespace :scrape do
puts "Done! #{duration} secs"
puts "Saved to: " + scrapr.save
end

def harvest(destination = DUMP_PATH)
@categories.each do |section, url|
@all_emoji[section] = collect_emoji_list(url)
dump_to_yaml(section + '_urls', scrapr.all_emoji.fetch(section,[]))
collect_all_emoji(section)
dump_to_yaml(section, scrapr.all_emoji.fetch(section,[]))
end
end

def collect_all_emoji(section , delay = 2)

scrape_all_emoji_in_category(@all_emoji[section], delay)
end
end
Loading

0 comments on commit 94156e2

Please sign in to comment.