Giter Club home page Giter Club logo

vimgolf-finder's Introduction

VimGolf Finder 🔎

Build Status

Simple VimGolf challenge finder. It just toy project for me! 😄

Preview

asciicast

Installation

Paste this at a terminal prompt:

$ gem install vimgolf-finder

Usage

Commands:
  vimgolf-finder help [COMMAND]  # Describe available commands or one specific command
  vimgolf-finder list            # Show VimGolf challenges
  vimgolf-finder random          # Pick one at random from VimGolf challenges
  vimgolf-finder solves          # Show solved VimGolf challenges

List 🔎

Show VimGolf challenges from 'http://vimgolf.com/'.

$ vimgolf-finder list
1. Simple text editing with Vim - 8304 entries (4d1a34ccfa85f32065000004)
2. Simple, Practical, and Common - 7945 entries (55b18bbea9c2c30d04000001)
3. Words in parens - 7806 entries (5192f96ad8df110002000002)
4. A HAPPY NEW YEAR 2014 ! - 7022 entries (52c3cb0d9b8634000200000e)
5. Just the middle - 5262 entries (54862fbb3f90ac0002904cf5)
6. I forgot quotes - 5034 entries (5462e3f41198b80002512673)
7. Reformat/Refactor a Golfer Class - 4878 entries (4d1a1c36567bac34a9000002)
8. switch variable - 3431 entries (4f0720c8f037090001000007)
9. Search and Replace 0 - 3234 entries (4d1a8bf2b8cb3409320002c4)
10. Vice versa - 2908 entries (55bcdc3ef4219f456102374f)
Choose challenge number. 2

Open your web browser? (y/n) y
Do you want to play? (y/n) y

# Playing VimGolf...

Thanks for playing!
Solves? (y/n) y
[✓] Checked!

Options

Options:
  o, [--order=ORDER]
                            # Default: entries
  d, [--desc], [--no-desc]
                            # Default: true
  l, [--limit=LIMIT]
                            # Default: 10
  p, [--page=PAGE]
                            # Default: 1

Random 🔎

Pick one at random from VimGolf challenges

$ vimgolf-finder random
1. C to VimDict - 38 entries (54a94976f4048c00026d8ed6)

Open your web browser? (y/n) n
Waiting...
C to VimDict
Convert a C data structure to a Vimscript dictionary.
--------------------------------------------------
Start File
{ "Return", '\n', },
{ "ampersand", '&', },
{ "apostrophe", '\'', },
{ "asciicircum", '^', },
{ "asciitilde", '~', },
{ "asterisk", '*', },
{ "at", '@', },
{ "backslash", '\\', },
--------------------------------------------------
End File
{
\  "\n" : 'Return',
\  "&"  : 'ampersand',
\  "\'" : 'apostrophe',
\  "^"  : 'asciicircum',
\  "~"  : 'asciitilde',
\  "*"  : 'asterisk',
\  "@"  : 'at',
\  "\\" : 'backslash',
\}
--------------------------------------------------
Do you want to play? (y/n) y

# Playing VimGolf...

Thanks for playing!
Solves? (y/n) n

Solves 🔎

Show solved VimGolf challenges

$ vimgolf-finder solves
1. Simple, Practical, and Common - 7953 entries (55b18bbea9c2c30d04000001) [✓]
Choose challenge number. 1

Open your web browser? (y/n) y
Do you want to play? (y/n) y

# Playing VimGolf...

Thanks for playing!
Solves? (y/n) y

TODO

  • Unit Testing
  • Refactoring

License

The MIT License (MIT)

Copyright (c) 2016 Lee Sun-Hyoup

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vimgolf-finder's People

Contributors

kciter avatar

Stargazers

Weijian Duan avatar ratworld avatar Yash Gaitonde avatar 이강호 avatar Chris avatar Dominik Böhler avatar  avatar Vi Pau avatar ParkSungho avatar Jong Hyeon Yeo avatar  avatar ChangJoo Park(박창주) avatar  avatar Zsófia Balogh avatar Jaroslaw Truchan avatar dummy avatar cheongjin kim (김청진) avatar mindong avatar KIM, WOOJUNG avatar Youngwoong Choi avatar sanghyeok avatar Jeewhan avatar Moses Miller avatar Javier Blanco Gutiérrez avatar HustLion avatar 박 재성 avatar Matteo Baglini avatar Jinun Park avatar Matthieu Coudron avatar Evgenii Morozov avatar Ryeoeun Kim avatar  avatar Penil avatar pilgwon avatar Yoon Myunggeun avatar Duncan Regan avatar Rafael Bodill avatar Sean Ellefson avatar  avatar nobe4 avatar Stanko Krtalić avatar Taejun Kim avatar 길상혁 avatar Jihwan Kyle Kim avatar  avatar Hoyoung Jung avatar

Watchers

evandrix avatar James Cloos avatar  avatar  avatar

Forkers

honux77 iq-scm

vimgolf-finder's Issues

Thor dependency broken!

$ vimgolf-finder help |xclip
Traceback (most recent call last):
        8: from /usr/bin/vimgolf-finder:23:in `<main>'
        7: from /usr/lib/ruby/2.5.0/rubygems.rb:309:in `activate_bin_path'
        6: from /usr/lib/ruby/2.5.0/rubygems.rb:309:in `synchronize'
        5: from /usr/lib/ruby/2.5.0/rubygems.rb:310:in `block in activate_bin_path'
        4: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1440:in `activate'
        3: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `activate_dependencies'
        2: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1458:in `each'
        1: from /usr/lib/ruby/2.5.0/rubygems/specification.rb:1469:in `block in activate_dependencies'
/usr/lib/ruby/2.5.0/rubygems/dependency.rb:312:in `to_specs': Could not find 'thor' (~> 0.19.1) - did find: [thor-0.20.0] (Gem::MissingSpecVersionError)
Checked in 'GEM_PATH=~/.gem/ruby/2.5.0:/usr/lib/ruby/gems/2.5.0', execute `gem env` for more information

Web parser fails when trying to parse diff

The program crashes on vimgolf-finder list after the "Open your web browser?" prompt with this error:

/var/lib/gems/2.3.0/gems/vimgolf-finder-0.1.7/lib/vimgolf_finder/parser.rb:33:in `block in get_challenge': undefined method `content' for nil:NilClass (NoMethodError)
	from /var/lib/gems/2.3.0/gems/nokogiri-1.10.7/lib/nokogiri/xml/node_set.rb:238:in `block in each'
	from /var/lib/gems/2.3.0/gems/nokogiri-1.10.7/lib/nokogiri/xml/node_set.rb:237:in `upto'
	from /var/lib/gems/2.3.0/gems/nokogiri-1.10.7/lib/nokogiri/xml/node_set.rb:237:in `each'
	from /var/lib/gems/2.3.0/gems/vimgolf-finder-0.1.7/lib/vimgolf_finder/parser.rb:27:in `get_challenge'
	from /var/lib/gems/2.3.0/gems/vimgolf-finder-0.1.7/lib/vimgolf_finder/cli.rb:118:in `print_challenge'
	from /var/lib/gems/2.3.0/gems/vimgolf-finder-0.1.7/lib/vimgolf_finder/cli.rb:64:in `list'
	from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
	from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
	from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
	from /var/lib/gems/2.3.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
	from /var/lib/gems/2.3.0/gems/vimgolf-finder-0.1.7/lib/vimgolf_finder/cli.rb:20:in `start'
	from /var/lib/gems/2.3.0/gems/vimgolf-finder-0.1.7/bin/vimgolf-finder:9:in `<top (required)>'
	from /usr/local/bin/vimgolf-finder:23:in `load'
	from /usr/local/bin/vimgolf-finder:23:in `<main>'

It crashes on both my machines:

  • Ubuntu Server 18.04
  • Ubuntu 16.04

It seems like the error comes from this line:

 challenge.view_diff = dom.at_css('pre.diff').content

And stems from a change in the DOM on vimgolf.com.

warning이 발생합니다.

간만에 돌렸더니 경고가 나오고 있네요.
@kciter 업데이트 안해주시나요?

[email protected]:~/temp $ vimgolf-finder list
Expected string default value for '--limit'; got 10 (numeric)
Expected string default value for '--page'; got 1 (numeric)
1. Rural Post - 3816 entries (5f1e0217becb80000692b9c4)
2. Satisfy the go linter - 1646 entries (5f1063aa8361810006e73210)
3. swap number pairs - 1306 entries (5fa95fbdd285680008e41e4b)
4. Inverting Lines - 1056 entries (60340000c06738000924d803)
5. simple replacements - 748 entries (603ba26a01b4d00009c10a49)
6. Plotting some variables in python - 687 entries (9v0060da5177000000000209)
7. Modernise code - 677 entries (5fd1ea4cf90da80006545d46)
8. Add quotes to ansible playbook - 604 entries (5f0f5fbe280fbf000c233304)
9. HS Final exam vimgolf - 589 entries (5fa53808a4d481000c3f114d)
10. hello-world-vimgolf - 535 entries (9v0061478032000000000212)
Choose challenge number. 10
/Library/Ruby/Gems/2.6.0/gems/vimgolf-finder-0.1.7/lib/vimgolf_finder/cli.rb:57: warning: constant ::Fixnum is deprecated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.