Skip to content

Latest commit

 

History

History
89 lines (65 loc) · 2.7 KB

README.md

File metadata and controls

89 lines (65 loc) · 2.7 KB

JottitTo

Gem Version Build Status Dependency Status Code Climate Coverage Status

Jottit list page converter for CLI

Installation

$ gem install jottit-to

Usage

As a tool for CLI:

$ jotto json http://youpy.jottit.com/trivia
["Evernoteは象で動いている","CD音質を超えるデータはすべてハイレゾ", ...

$ jotto yaml http://youpy.jottit.com/trivia | head
---
- Evernoteは象で動いている
- CD音質を超えるデータはすべてハイレゾ
 :

$ jotto text http://youpy.jottit.com/trivia | head
Evernoteは象で動いている
CD音質を超えるデータはすべてハイレゾ
 :

$ jotto xml http://youpy.jottit.com/trivia | head
<?xml version="1.0" encoding="UTF-8"?>
<items>
  <item>Evernoteは象で動いている</item>
  <item>CD音質を超えるデータはすべてハイレゾ</item>
 : 

Show help

$ jotto help
Commands:
  jotto help [COMMAND]  # Describe available commands or one specific command
  jotto json URI        # Show as json
  jotto text URI        # Show as text
  :
  :

Applications for CLI:

  • Fetch random one

    $ jotto text http://youpy.jottit.com/trivia | shuf -n 1
    高性能な機械は触ると少しひんやりする
  • Tweet a trivia with usging tw gem ( http://shokai.github.io/tw/ )

    $ jotto text http://youpy.jottit.com/trivia | shuf -n 1 | tw --pipe
    首をボキボキ鳴らすと1トンの衝撃がかかる
    http://twitter.com/toby_net/status/451337693436198913
    2014-04-02 21:37:46 +0900
  • Tweet a trivia like yazawa using YAZAWA gem ( https://github.com/tobynet/yazawa ) and tw

    $ jotto text http://youpy.jottit.com/trivia | shuf -n 1 | yazawa | tw --pipe
    『SOUJI』は人を裏切らない
    http://twitter.com/toby_net/status/451338808189911040
    2014-04-02 21:42:12 +0900

As a library of ruby:

require 'jottit-to'

uri = 'http://youpy.jottit.com/trivia'

puts JottitTo.parse_uri(uri).to_json    # Fetch and print as JSON
puts JottitTo.parse_uri(uri).to_yaml    # Fetch and print as yaml
puts JottitTo.parse_uri(uri).to_text    # Fetch and print as text
puts JottitTo.parse_uri(uri).to_xml     # Fetch and print as xml