forked from id774/automaticruby
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPLUGINS
More file actions
750 lines (567 loc) · 13.6 KB
/
PLUGINS
File metadata and controls
750 lines (567 loc) · 13.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
===========================
Description of the plug-ins
===========================
SubscriptionFeed
----------------
[Path]
/plugins/subscription/feed.rb
[Abstract]
Subscribe to feed.
[Syntax]
- module: SubscriptionFeed
config:
feeds:
- FEED
- FEED ...
retry: RETRY_COUNT
interval: INTERVAL_FOR_RETRY (in seconds.)
SubscriptionLink
----------------
[Path]
/plugins/subscription/link.rb
[Abstract]
Subscribe urls and extract there links.
[Syntax]
- module: SubscriptionLink
config:
urls:
- URL
- URL ...
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionXml
---------------
[Path]
/plugins/subscription/xml.rb
[Abstract]
Subscribe XML API with GET method.
This plug-in store encoded XML in content_encoded of RSS feed.
[Syntax]
- module: SubscriptionXml
config:
urls:
- URL
- URL ... (XML base API)
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionTumblr
------------------
[Path]
/plugins/subscription/tumblr.rb
[Abstract]
Subscribe tumblr and extract the links.
If pages specified, including past pages.
[Syntax]
- module: SubscriptionTumblr
config:
urls:
- URL
- URL ...
pages: PAGES
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionTwitter
-------------------
[Path]
/plugins/subscription/twitter.rb
[Abstract]
Subscribe twitter and extract there statuses and the links.
[Syntax]
- module: SubscriptionTwittter
config:
urls:
- URL
- URL ...
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionTwitterSearch
-------------------------
[Path]
/plugins/subscription/twitter_search.rb
[Abstract]
The search results of a twitter are acquired.
[Syntax]
- module: SubscriptionTwitterSearch
config:
search: search word
opt: option
consumer_key: 'your_consumer_key'
consumer_secret: 'your_consumer_secret'
oauth_token: 'your_oauth_token'
oauth_token_secret: 'your_oauth_token_secret'
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionWeather
-------------------
[Path]
/plugins/subscription/weather.rb
[Abstract]
Subscribe weather (using gem weather_hacker) by zipcode.
[Syntax]
- module: SubscriptionWeather
config:
zipcode: ZIPCODE (ex. 166-0003)
day: DAY (ex. 'today', 'tomorrow')
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionText
----------------
[Path]
/plugins/subscription/text.rb
[Abstract]
Create new feeds from urls, titles, feeds on text.
Reading data from TSV (sep = '\t') formatted files.
[Syntax]
- module: SubscriptionText
config:
titles:
- 'title'
urls:
- 'url'
feeds:
-
title: 'title'
url: 'url'
-
title: 'title'
url: 'url'
files:
- 'somefile1.tsv'
- 'somefile2.tsv'
SubscriptionPocket
------------------
[Path]
/plugins/subscription/pocket.rb
[Abstract]
Pocket API is struck and it is creation of feed.
[Syntax]
- module: SubscriptionPocket
config:
consumer_key: 'your_consumer_key'
access_token: 'your_access_token'
optional: # see http://getpocket.com/developer/docs/v3/retrieve
favorite: 1
count: 2
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionGGuide
------------------
[Path]
/plugins/subscription/g_guide.rb
[Abstract]
search keyword to the G guide (information on a TV program) rss
[Syntax]
- module: SubscriptionGGuide
config:
keyword: 'anime,shogi' # search word (',' dividing and coming out two or more search)
station: '地上波' # (It means terrestrial broadcasting in Japanese.)
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
SubscriptionChanToru
--------------------
[Path]
/plugins/subscription/chan_toru.rb
[Abstract]
Search keyword to CHAN-TORU (information on a TV program) rss
(SubscriptionGGuide Plug-in dependence)
[Syntax]
- module: SubscriptionChanToru
config:
keyword: 'anime' # search word
station: '地上波' # (It means terrestrial broadcasting in Japanese.)
interval: INTERVAL_FOR_SCRAPING (in seconds.)
retry: RETRY_COUNT
FilterClear
-----------
[Path]
/plugins/filter/clear.rb
[Abstract]
Clear Pipeline.
[Syntax]
- module: FilterClear
FilterSort
----------
[Path]
/plugins/filter/sort.rb
[Abstract]
Sort feed by date asc or desc.
If desc is specified, it's sort feed by date desc.
[Syntax]
- module: FilterSort
config:
sort: asc or desc
FilterIgnore
------------
[Path]
/plugins/filter/ignore.rb
[Abstract]
Exclude the NG word.
[Syntax]
- module: FilterIgnore
config:
link:
- KEYWORD
- KEYWORD ...
description:
- KEYWORD
- KEYWORD ...
FilterAccept
------------
[Path]
/plugins/filter/accept.rb
[Abstract]
Contain the OK word.
[Syntax]
- module: FilterAccept
config:
link:
- KEYWORD
- KEYWORD ...
description:
- KEYWORD
- KEYWORD ...
FilterImage
-----------
[Path]
/plugins/filter/image.rb
[Abstract]
Extract images from the link.
If not image, the permalink will be nil.
[Syntax]
- module: FilterImage
FilterImageSource
-----------------
[Path]
/plugins/filter/image_source.rb
[Abstract]
Rewrite the permalink to source of the image in the contents.
If there is no source of image, the permalink will be nil.
[Syntax]
- module: FilterImageSource
FilterOne
---------
[Path]
/plugins/filter/one.rb
[Abstract]
Select a item from items.
[Syntax]
- module: FilterOne
config:
pick: last (If none, pick the first item.)
FilterRand
----------
[Path]
/plugins/filter/rand.rb
[Abstract]
Randomize the array of the feed items.
[Syntax]
- module: FilterRand
FilterSanitize
--------------
[Path]
/plugins/filter/sanitize.rb
[Abstract]
Strip the html tags.
Reference: https://github.com/rgrove/sanitize
[Syntax]
- module: FilterSanitize
config:
mode: basic or relaxed or restricted
(default: restricted)
FilterFullFeed
--------------
[Path]
/plugins/filter/full_feed.rb
[Abstract]
Get full text of feed entry.
[Syntax]
- module: FilterFeed
config:
siteinfo: your siteinfo file's path
FilterAbsoluteURI
-----------------
[Path]
/plugins/filter/absolute_uri.rb
[Description]
Rewrite relative path to absolute one.
[Syntax]
- module: FilterAbsoluteURI
config:
url: http://targethost.com/
FilterTumblrResize
------------------
[Path]
/plugins/filter/tumblr_resize.rb
[Abstract]
Rewrite the permalink to the maximum size of
the Tumblr (High Res).
[Assumption]
It has already been rewritten to perm link image link
[Syntax]
- module: FilterTumblrResize
FilterDescriptionLink
---------------------
[Path]
/plugins/filter/description_link.rb
[Abstract]
Pickup http or https URL from description.
Re-write link to the URL.
[Syntax]
- module: FilterDescriptionLink
config:
clear_description: 1 # Set empty to description.
get_title: 1 # Get title after re-write link.
FilterGoogleNews
----------------
[Path]
/plugins/filter/google_news.rb
[Abstract]
Re-write Google News link to a new link of the redirect.
[Syntax]
- module: FilterGoogleNews
StorePermalink
--------------
[Path]
/plugins/store/permalink.rb
[Abstract]
Save a permanent link.
The duplicate permalink will be discarded.
[Syntax]
- module: StorePermalink
config:
db: DB_NAME
StoreFullText
-------------
[Path]
/plugins/store/full_text.rb
[Abstract]
Save a full text of contents.
Saved text can be viewed in the viewer below
https://github.com/id774/blog_viewer
[Syntax]
- Module: StoreFullText
config:
db: DB_NAME
StoreFile
---------
[Path]
/plugins/store/file.rb
[Abstract]
Store target to local file system.
This emulate "Right click to save"
If scheme begin with "s3n://", get file from Amazon S3.
Re-write URI scheme to file URI scheme and return feeds.
[Syntax]
- Module: StoreFile
config:
path: SAVE_TO_PATH
retry: RETRY_COUNT
interval: INTERVAL_FOR_DOWNLOAD (in seconds.)
access_key: ACCESS_KEY_ID (Only using S3)
secret_key: SECRET_ACCESS_KEY (Only using S3)
bucket_name: AMAZONS3_BUCKET_NAME (Only using S3)
PublishConsole
--------------
[Path]
/plugins/publish/console.rb
[Abstract]
Output pipeline to the console.
[Syntax]
- module: PublishConsole
PublishAmazonS3
---------------
[Path]
/plugins/publish/amazon_s3.rb
[Abstract]
Upload file to Amazon S3.
[Description]
Read file URI scheme and upload it to aws.
Postulate feed link must be file URI scheme.
[Syntax]
- module: PublishAmazonS3
config:
access_key: ACCESS_KEY_ID
secret_key: SECRET_ACCESS_KEY
bucket_name: AMAZONS3_BUCKET_NAME
target_path: PATH_ON_BUCKET
PublishFluentd
--------------
[Path]
/plugins/publish/fluentd.rb
[Abstract]
Output to fluentd with fluent-logger.
[Description]
This plugin outputs feed to fluentd.
Following fluentd config example.
<source>
type forward
port 9999
</source>
[Syntax]
- module: PublishFluentd
config:
host: HOSTNAME
port: PORT_NUMBER
tag: TAGS (example: automatic.feed)
ProvideFluentd
--------------
[Path]
/plugins/provide/fluentd.rb
[Abstract]
This plugin output content_encoded to fluentd.
[Description]
Provide::Fluentd is different from Publish::Fluentd.
Publish::Fluentd -> Output feed to flulentd.
Provide::Fluentd -> Output content_encoded to fluentd.
[Syntax]
- module: ProvideFluentd
config:
host: HOSTNAME
port: PORT_NUMBER
tag: TAGS (example: automatic.feed)
PublishMemcached
----------------
[Path]
/plugins/publish/memcached.rb
[Abstract]
Output feeds converted hash to memcached with dalli.
[Syntax]
- module: PublishMemcached
config:
host: HOSTNAME
port: PORT_NUMBER
key: KEY
PublishHatenaBookmark
---------------------
[Path]
/plugins/publish/hatenabookmark.rb
[Abstract]
Bookmarking to Hatena Bookmark (Social Bookmark).
[Description]
Generate the XML for submission to
Hatena Bookmark API.
[Syntax]
- module: PublishHatenaBookmark
config:
username: HATENA_ID
passowrd: PASSWORD
interval: INTERVAL_FOR_BOOKMARK (in seconds.)
PublishTwitter
--------------
[Path]
/plugins/publish/twitter.rb
[Abstract]
Publish to twitter.
[Syntax]
- module: PublishTwitter
config:
consumer_key: 'your_consumer_key'
consumer_secret: 'your_consumer_secret'
oauth_token: 'your_oauth_token'
oauth_token_secret: 'your_oauth_token_secret'
tweet_tmp: 'tweet text {link}'
interval: INTERVAL_FOR_RETRY (in seconds.)
retry: RETRY_COUNT
PublishPocket
-------------
[Path]
/plugins/publish/pocket.rb
[Abstract]
Register an appointment to Pocket.
[Description]
Submission to Pocket API. (using gem pocket-ruby)
[Syntax]
- module: PublishPocket
config:
consumer_key: CONSUMER_KEY
access_token: ACCESS_TOKEN
interval: INTERVAL_FOR_RETRY (in seconds.)
retry: RETRY_COUNT
PublishInstapaper
-----------------
[Path]
/plugins/publish/instapaper.rb
[Abstract]
Register an appointment to Instapaper.
[Description]
Submission to Instapaper API.
[Syntax]
- module: PublishInstapaper
config:
email: INSTAPAPER_ACCOUNT
password: PASSWORD
interval: INTERVAL_FOR_RETRY (in seconds.)
retry: RETRY_COUNT
PublishGoogleCalendar
---------------------
[Path]
/plugins/publish/google_calendar.rb
[Abstract]
Register an appointment to Google Calendar.
[Description]
Register item.title to Google Calendar.
[Syntax]
- module: PublishGoogleCalendar
config:
username: GOOGLE_ACCOUNT
password: PASSWORD
interval: INTERVAL
PublishEject
------------
[Path]
/plugins/publish/eject.rb
[Abstract]
eject by the feed link count.
[Syntax]
- module: PublishEject
config:
interval: INTERVAL
PublishHipchat
--------------
[Path]
/plugins/publish/hipchat.rb
[Abstract]
Register a message to HipChat
[Description]
Using HipChat API (https://www.hipchat.com/docs/api),
post a message to specific room.
[Syntax]
- module: PublishHipchat
config:
api_token: API token of HipChat (required)
room_id: ID or name of the room. (required)
username: Name the message will appear be sent from. (required)
color: Background color for message (default: yellow)
notify: Whether or not this message should trigger a notification for people in the room (0 => false, 1 => true, default: 0)
interval: INTERVAL_FOR_RETRY (in seconds.)
retry: RETRY_COUNT
NotifyIkachan
-------------
[Path]
/plugins/notify/ikachan.rb
[Abstract]
Send a message to ikachan.
[Description]
POST to ikachan via HTTP.
ikachan is: http://blog.yappo.jp/yappo/archives/000760.html
[Syntax]
- module: NotifyIkachan
config:
url: http://sample.com
port: 4979 # port number, the default is 4979.
channels: foo,bar,#baz # '#' is priced automatically, multiple by ','
command: notice # privmsg,notice etc..
interval: 5 # post interval. (s)
CustomFeedSVNLog
----------------
[Path]
/plugins/custom_feed/svn_log.rb
[Abstract]
Get new revision info from SVN.
[Description]
Get the number that is specified by fetch_items.
[Syntax]
- module: CustomFeedSVNLog
config:
target: http://redmine.rubyforge.org/svn
fetch_items: 2 # If not specified, 30