呼び出し元。set -exののち、スタートメッセージを表示 -> 引数で渡されたシェルスクリプトをsource -> エンドメッセージ表示
呼び出される子供。
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "引数1にrailsアプリ名を入れて下さい" 1>&2 | |
exit 1 | |
fi | |
cat << EOS > Gemfile | |
source "http://rubygems.org" | |
gem "rails", "3.2" |
# -*- coding: utf-8 -*- | |
require 'mechanize' | |
require 'webrat' | |
require 'pry' | |
Webrat.configure do |config| | |
config.mode = :mechanize | |
end |
module Fluent | |
class TextParser | |
class MyJSONParser | |
include Configurable | |
config_param :time_key, :string, :default => 'time' | |
config_param :time_format, :string, :default => nil | |
def call(text) |
#require 'open-uri' | |
max_id = 999999999999999999 | |
twitter_name = 'XXXXXXXXXXXXXXXX' | |
2.times do | |
tl = Twitter.user_timeline(twitter_name, count: 200, max_id: max_id, include_rts: false) | |
media_tl = tl.select{|tweet| !(tweet.media.empty?)} | |
media_tl.each {|tweet| `open #{tweet.media.first.url}`} | |
max_id = current.last.id |
package main | |
import "net/http" | |
import "net/url" | |
import "os" | |
import "fmt" | |
import "flag" | |
import "io/ioutil" |
package main | |
import "fmt" | |
import "time" | |
import "os" | |
import "flag" | |
func main() { | |
buffer_size := func() int { | |
b := 0 |
require 'webrat' | |
require 'mechanize' | |
class Hoge | |
Webrat.configure do |config| | |
config.mode = :mechanize | |
end | |
include Webrat::Methods |
:application.start(:asn1) | |
:application.start(:crypto) | |
:application.start(:public_key) | |
:application.start(:ssl) | |
:application.start(:inets) | |
[url, message] = System.argv() | |
:httpc.request(:post, {'#{url}', [], 'application/x-www-form-urlencoded', 'source=#{message}'}, [{:ssl,[{:verify,0}]}], []) |