|
Revision 5593, 435 bytes
(checked in by dzfl, 5 years ago)
|
|
lang/ruby/picrep: import
|
| Line | |
|---|
| 1 | #!/usr/bin/env ruby -Ku |
|---|
| 2 | |
|---|
| 3 | require 'rubygems' |
|---|
| 4 | require 'mechanize' |
|---|
| 5 | require 'yaml' |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | config = 'config.yaml' |
|---|
| 9 | |
|---|
| 10 | class Picrep |
|---|
| 11 | def initialize(config_file) |
|---|
| 12 | @config = YAML.load_file(config_file) |
|---|
| 13 | end |
|---|
| 14 | |
|---|
| 15 | def run |
|---|
| 16 | @config['plugins'].keys.each do |x| |
|---|
| 17 | require 'plugins/' + x.downcase |
|---|
| 18 | Picrep.const_get(x).new(@config['plugins'][x]['id'], @config['plugins'][x]['password'], @config['image']).update_pic |
|---|
| 19 | end |
|---|
| 20 | end |
|---|
| 21 | end |
|---|
| 22 | |
|---|
| 23 | Picrep.new(config).run |
|---|
| 24 | |
|---|