html2rss 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +76 -2
- data/html2rss.gemspec +4 -1
- data/lib/html2rss/auto_source/cleanup.rb +62 -36
- data/lib/html2rss/auto_source/scraper/json_state.rb +31 -22
- data/lib/html2rss/auto_source/scraper/schema/item_list.rb +2 -14
- data/lib/html2rss/auto_source/scraper/xhr_articles.rb +69 -0
- data/lib/html2rss/auto_source/scraper.rb +34 -15
- data/lib/html2rss/auto_source/segmenter/list.rb +3 -1
- data/lib/html2rss/auto_source/segmenter/primary_link.rb +6 -7
- data/lib/html2rss/auto_source/segmenter.rb +30 -1
- data/lib/html2rss/auto_source.rb +7 -2
- data/lib/html2rss/capture.rb +315 -0
- data/lib/html2rss/cli.rb +64 -5
- data/lib/html2rss/config/auto_source_contract.rb +3 -1
- data/lib/html2rss/config/schema.rb +67 -26
- data/lib/html2rss/config/selectors_validator.rb +60 -21
- data/lib/html2rss/config/validator.rb +18 -27
- data/lib/html2rss/error.rb +15 -3
- data/lib/html2rss/feed_pipeline/auto_fallback.rb +16 -6
- data/lib/html2rss/feed_pipeline/runtime_policy.rb +3 -43
- data/lib/html2rss/feed_pipeline.rb +10 -3
- data/lib/html2rss/hash_util.rb +17 -0
- data/lib/html2rss/html/sst_article_extractor.rb +36 -7
- data/lib/html2rss/link_destination/noise_policy.rb +7 -18
- data/lib/html2rss/link_destination/path_classifier.rb +3 -0
- data/lib/html2rss/mcp/server.rb +577 -0
- data/lib/html2rss/mcp.rb +21 -0
- data/lib/html2rss/request_service/blocked_surface.rb +24 -1
- data/lib/html2rss/request_service/botasaurus_contract.rb +89 -9
- data/lib/html2rss/request_service/botasaurus_strategy.rb +4 -2
- data/lib/html2rss/request_service/budget.rb +7 -35
- data/lib/html2rss/request_service/context.rb +0 -6
- data/lib/html2rss/request_service/faraday_strategy.rb +45 -2
- data/lib/html2rss/request_service/policy.rb +1 -1
- data/lib/html2rss/request_service/response.rb +15 -1
- data/lib/html2rss/request_service/strategy.rb +1 -2
- data/lib/html2rss/request_service.rb +4 -9
- data/lib/html2rss/scoring/container_assessor.rb +9 -15
- data/lib/html2rss/scoring/engine.rb +49 -5
- data/lib/html2rss/scoring/link_resolver.rb +12 -0
- data/lib/html2rss/scoring/ranked_segment.rb +0 -12
- data/lib/html2rss/scoring/score.rb +1 -20
- data/lib/html2rss/scoring.rb +0 -25
- data/lib/html2rss/selectors/extractors/attribute.rb +15 -0
- data/lib/html2rss/selectors/extractors/href.rb +12 -0
- data/lib/html2rss/selectors/extractors/html.rb +12 -0
- data/lib/html2rss/selectors/extractors/static.rb +14 -0
- data/lib/html2rss/selectors/extractors/text.rb +11 -0
- data/lib/html2rss/selectors/post_processors/gsub.rb +18 -0
- data/lib/html2rss/selectors/post_processors/html_to_markdown.rb +11 -0
- data/lib/html2rss/selectors/post_processors/markdown_to_html.rb +12 -0
- data/lib/html2rss/selectors/post_processors/parse_time.rb +11 -0
- data/lib/html2rss/selectors/post_processors/parse_uri.rb +11 -0
- data/lib/html2rss/selectors/post_processors/sanitize_html.rb +13 -0
- data/lib/html2rss/selectors/post_processors/substring.rb +21 -0
- data/lib/html2rss/selectors/post_processors/template.rb +20 -0
- data/lib/html2rss/selectors/schema_doc.rb +99 -0
- data/lib/html2rss/url.rb +11 -7
- data/lib/html2rss/version.rb +1 -1
- data/lib/html2rss.rb +32 -1
- data/schema/html2rss-config.schema.json +408 -85
- metadata +54 -12
- data/lib/html2rss/request_service/browserless_strategy.rb +0 -132
- data/lib/html2rss/request_service/puppet_commander/navigation_guards.rb +0 -148
- data/lib/html2rss/request_service/puppet_commander/preload_runner.rb +0 -86
- data/lib/html2rss/request_service/puppet_commander.rb +0 -95
- data/lib/html2rss/scoring/anchor_score.rb +0 -34
|
@@ -63,6 +63,37 @@
|
|
|
63
63
|
"url"
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
|
+
"directory": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"properties": {
|
|
69
|
+
"topics": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"items": {
|
|
72
|
+
"minLength": 1,
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": [
|
|
75
|
+
"sports",
|
|
76
|
+
"energy",
|
|
77
|
+
"tech",
|
|
78
|
+
"science",
|
|
79
|
+
"news",
|
|
80
|
+
"entertainment",
|
|
81
|
+
"jobs",
|
|
82
|
+
"finance",
|
|
83
|
+
"security",
|
|
84
|
+
"travel",
|
|
85
|
+
"environment",
|
|
86
|
+
"consumer",
|
|
87
|
+
"civic",
|
|
88
|
+
"product",
|
|
89
|
+
"research"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"minItems": 1
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"required": []
|
|
96
|
+
},
|
|
66
97
|
"headers": {
|
|
67
98
|
"type": "object",
|
|
68
99
|
"description": "HTTP headers applied to every request.",
|
|
@@ -201,6 +232,18 @@
|
|
|
201
232
|
},
|
|
202
233
|
"required": []
|
|
203
234
|
},
|
|
235
|
+
"xhr_articles": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"enabled": {
|
|
239
|
+
"type": "boolean",
|
|
240
|
+
"not": {
|
|
241
|
+
"type": "null"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"required": []
|
|
246
|
+
},
|
|
204
247
|
"meta_oembed": {
|
|
205
248
|
"type": "object",
|
|
206
249
|
"properties": {
|
|
@@ -274,13 +317,6 @@
|
|
|
274
317
|
"not": {
|
|
275
318
|
"type": "null"
|
|
276
319
|
}
|
|
277
|
-
},
|
|
278
|
-
"min_words_title": {
|
|
279
|
-
"type": "integer",
|
|
280
|
-
"not": {
|
|
281
|
-
"type": "null"
|
|
282
|
-
},
|
|
283
|
-
"exclusiveMinimum": 0
|
|
284
320
|
}
|
|
285
321
|
},
|
|
286
322
|
"required": []
|
|
@@ -310,6 +346,9 @@
|
|
|
310
346
|
"json_state": {
|
|
311
347
|
"enabled": true
|
|
312
348
|
},
|
|
349
|
+
"xhr_articles": {
|
|
350
|
+
"enabled": true
|
|
351
|
+
},
|
|
313
352
|
"meta_oembed": {
|
|
314
353
|
"enabled": true
|
|
315
354
|
},
|
|
@@ -325,8 +364,7 @@
|
|
|
325
364
|
}
|
|
326
365
|
},
|
|
327
366
|
"cleanup": {
|
|
328
|
-
"keep_different_domain": false
|
|
329
|
-
"min_words_title": 3
|
|
367
|
+
"keep_different_domain": false
|
|
330
368
|
}
|
|
331
369
|
}
|
|
332
370
|
},
|
|
@@ -422,8 +460,24 @@
|
|
|
422
460
|
"type": "object",
|
|
423
461
|
"properties": {
|
|
424
462
|
"extractor": {
|
|
425
|
-
"
|
|
426
|
-
"
|
|
463
|
+
"description": "Extractor used to pull a value from the selected element.",
|
|
464
|
+
"oneOf": [
|
|
465
|
+
{
|
|
466
|
+
"$ref": "#/$defs/extractors/attribute"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"$ref": "#/$defs/extractors/href"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"$ref": "#/$defs/extractors/html"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"$ref": "#/$defs/extractors/static"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"$ref": "#/$defs/extractors/text"
|
|
479
|
+
}
|
|
480
|
+
]
|
|
427
481
|
},
|
|
428
482
|
"attribute": {
|
|
429
483
|
"type": "string",
|
|
@@ -435,8 +489,34 @@
|
|
|
435
489
|
},
|
|
436
490
|
"post_process": {
|
|
437
491
|
"type": "array",
|
|
492
|
+
"description": "Ordered transforms applied to the extracted value.",
|
|
438
493
|
"items": {
|
|
439
|
-
"
|
|
494
|
+
"oneOf": [
|
|
495
|
+
{
|
|
496
|
+
"$ref": "#/$defs/post_processors/gsub"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"$ref": "#/$defs/post_processors/html_to_markdown"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"$ref": "#/$defs/post_processors/markdown_to_html"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"$ref": "#/$defs/post_processors/parse_time"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"$ref": "#/$defs/post_processors/parse_uri"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"$ref": "#/$defs/post_processors/sanitize_html"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"$ref": "#/$defs/post_processors/substring"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"$ref": "#/$defs/post_processors/template"
|
|
518
|
+
}
|
|
519
|
+
]
|
|
440
520
|
}
|
|
441
521
|
},
|
|
442
522
|
"content_type": {
|
|
@@ -472,8 +552,24 @@
|
|
|
472
552
|
"type": "object",
|
|
473
553
|
"properties": {
|
|
474
554
|
"extractor": {
|
|
475
|
-
"
|
|
476
|
-
"
|
|
555
|
+
"description": "Extractor used to pull a value from the selected element.",
|
|
556
|
+
"oneOf": [
|
|
557
|
+
{
|
|
558
|
+
"$ref": "#/$defs/extractors/attribute"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"$ref": "#/$defs/extractors/href"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"$ref": "#/$defs/extractors/html"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"$ref": "#/$defs/extractors/static"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"$ref": "#/$defs/extractors/text"
|
|
571
|
+
}
|
|
572
|
+
]
|
|
477
573
|
},
|
|
478
574
|
"attribute": {
|
|
479
575
|
"type": "string",
|
|
@@ -485,8 +581,34 @@
|
|
|
485
581
|
},
|
|
486
582
|
"post_process": {
|
|
487
583
|
"type": "array",
|
|
584
|
+
"description": "Ordered transforms applied to the extracted value.",
|
|
488
585
|
"items": {
|
|
489
|
-
"
|
|
586
|
+
"oneOf": [
|
|
587
|
+
{
|
|
588
|
+
"$ref": "#/$defs/post_processors/gsub"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
"$ref": "#/$defs/post_processors/html_to_markdown"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"$ref": "#/$defs/post_processors/markdown_to_html"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
"$ref": "#/$defs/post_processors/parse_time"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"$ref": "#/$defs/post_processors/parse_uri"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"$ref": "#/$defs/post_processors/sanitize_html"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"$ref": "#/$defs/post_processors/substring"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"$ref": "#/$defs/post_processors/template"
|
|
610
|
+
}
|
|
611
|
+
]
|
|
490
612
|
}
|
|
491
613
|
}
|
|
492
614
|
},
|
|
@@ -520,77 +642,18 @@
|
|
|
520
642
|
},
|
|
521
643
|
"exclusiveMinimum": 0
|
|
522
644
|
},
|
|
523
|
-
"browserless": {
|
|
524
|
-
"type": "object",
|
|
525
|
-
"properties": {
|
|
526
|
-
"preload": {
|
|
527
|
-
"type": "object",
|
|
528
|
-
"properties": {
|
|
529
|
-
"wait_after_ms": {
|
|
530
|
-
"type": "integer",
|
|
531
|
-
"not": {
|
|
532
|
-
"type": "null"
|
|
533
|
-
},
|
|
534
|
-
"minimum": 0
|
|
535
|
-
},
|
|
536
|
-
"click_selectors": {
|
|
537
|
-
"type": "array",
|
|
538
|
-
"items": {
|
|
539
|
-
"type": "object",
|
|
540
|
-
"properties": {
|
|
541
|
-
"selector": {
|
|
542
|
-
"type": "string",
|
|
543
|
-
"minLength": 1
|
|
544
|
-
},
|
|
545
|
-
"max_clicks": {
|
|
546
|
-
"type": "integer",
|
|
547
|
-
"not": {
|
|
548
|
-
"type": "null"
|
|
549
|
-
},
|
|
550
|
-
"exclusiveMinimum": 0
|
|
551
|
-
},
|
|
552
|
-
"wait_after_ms": {
|
|
553
|
-
"type": "integer",
|
|
554
|
-
"not": {
|
|
555
|
-
"type": "null"
|
|
556
|
-
},
|
|
557
|
-
"minimum": 0
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
"required": [
|
|
561
|
-
"selector"
|
|
562
|
-
]
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
"scroll_down": {
|
|
566
|
-
"type": "object",
|
|
567
|
-
"properties": {
|
|
568
|
-
"iterations": {
|
|
569
|
-
"type": "integer",
|
|
570
|
-
"not": {
|
|
571
|
-
"type": "null"
|
|
572
|
-
},
|
|
573
|
-
"exclusiveMinimum": 0
|
|
574
|
-
},
|
|
575
|
-
"wait_after_ms": {
|
|
576
|
-
"type": "integer",
|
|
577
|
-
"not": {
|
|
578
|
-
"type": "null"
|
|
579
|
-
},
|
|
580
|
-
"minimum": 0
|
|
581
|
-
}
|
|
582
|
-
},
|
|
583
|
-
"required": []
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
"required": []
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
"required": []
|
|
590
|
-
},
|
|
591
645
|
"botasaurus": {
|
|
592
646
|
"type": "object",
|
|
593
647
|
"properties": {
|
|
648
|
+
"execution_mode": {
|
|
649
|
+
"type": "string",
|
|
650
|
+
"minLength": 1,
|
|
651
|
+
"enum": [
|
|
652
|
+
"auto",
|
|
653
|
+
"request",
|
|
654
|
+
"browser"
|
|
655
|
+
]
|
|
656
|
+
},
|
|
594
657
|
"navigation_mode": {
|
|
595
658
|
"type": "string",
|
|
596
659
|
"minLength": 1,
|
|
@@ -598,7 +661,8 @@
|
|
|
598
661
|
"auto",
|
|
599
662
|
"get",
|
|
600
663
|
"google_get",
|
|
601
|
-
"google_get_bypass"
|
|
664
|
+
"google_get_bypass",
|
|
665
|
+
"organic_get"
|
|
602
666
|
]
|
|
603
667
|
},
|
|
604
668
|
"max_retries": {
|
|
@@ -622,6 +686,18 @@
|
|
|
622
686
|
},
|
|
623
687
|
"exclusiveMinimum": 0
|
|
624
688
|
},
|
|
689
|
+
"scroll": {
|
|
690
|
+
"type": "boolean",
|
|
691
|
+
"not": {
|
|
692
|
+
"type": "null"
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
"scroll_to_bottom": {
|
|
696
|
+
"type": "boolean",
|
|
697
|
+
"not": {
|
|
698
|
+
"type": "null"
|
|
699
|
+
}
|
|
700
|
+
},
|
|
625
701
|
"block_images": {
|
|
626
702
|
"type": "boolean",
|
|
627
703
|
"not": {
|
|
@@ -634,6 +710,12 @@
|
|
|
634
710
|
"type": "null"
|
|
635
711
|
}
|
|
636
712
|
},
|
|
713
|
+
"block_trackers": {
|
|
714
|
+
"type": "boolean",
|
|
715
|
+
"not": {
|
|
716
|
+
"type": "null"
|
|
717
|
+
}
|
|
718
|
+
},
|
|
637
719
|
"wait_for_complete_page_load": {
|
|
638
720
|
"type": "boolean",
|
|
639
721
|
"not": {
|
|
@@ -666,6 +748,12 @@
|
|
|
666
748
|
"lang": {
|
|
667
749
|
"type": "string",
|
|
668
750
|
"minLength": 1
|
|
751
|
+
},
|
|
752
|
+
"cookies": {
|
|
753
|
+
"type": "object"
|
|
754
|
+
},
|
|
755
|
+
"headers": {
|
|
756
|
+
"type": "object"
|
|
669
757
|
}
|
|
670
758
|
},
|
|
671
759
|
"required": []
|
|
@@ -692,5 +780,240 @@
|
|
|
692
780
|
"auto_source"
|
|
693
781
|
]
|
|
694
782
|
}
|
|
695
|
-
]
|
|
783
|
+
],
|
|
784
|
+
"$defs": {
|
|
785
|
+
"post_processors": {
|
|
786
|
+
"gsub": {
|
|
787
|
+
"type": "object",
|
|
788
|
+
"title": "gsub",
|
|
789
|
+
"description": "Replace matches of `pattern` in the extracted string with `replacement` (Ruby String#gsub; pattern may be a regexp-like string).",
|
|
790
|
+
"examples": [
|
|
791
|
+
{
|
|
792
|
+
"name": "gsub",
|
|
793
|
+
"pattern": "boo",
|
|
794
|
+
"replacement": "baz"
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"properties": {
|
|
798
|
+
"name": {
|
|
799
|
+
"type": "string",
|
|
800
|
+
"const": "gsub"
|
|
801
|
+
},
|
|
802
|
+
"pattern": {
|
|
803
|
+
"type": "string"
|
|
804
|
+
},
|
|
805
|
+
"replacement": {
|
|
806
|
+
"type": "string"
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
"required": [
|
|
810
|
+
"name",
|
|
811
|
+
"pattern",
|
|
812
|
+
"replacement"
|
|
813
|
+
],
|
|
814
|
+
"additionalProperties": true
|
|
815
|
+
},
|
|
816
|
+
"html_to_markdown": {
|
|
817
|
+
"type": "object",
|
|
818
|
+
"title": "html_to_markdown",
|
|
819
|
+
"description": "Sanitize HTML then convert it to Markdown (via ReverseMarkdown).",
|
|
820
|
+
"examples": [
|
|
821
|
+
{
|
|
822
|
+
"name": "html_to_markdown"
|
|
823
|
+
}
|
|
824
|
+
],
|
|
825
|
+
"properties": {
|
|
826
|
+
"name": {
|
|
827
|
+
"type": "string",
|
|
828
|
+
"const": "html_to_markdown"
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
"required": [
|
|
832
|
+
"name"
|
|
833
|
+
],
|
|
834
|
+
"additionalProperties": true
|
|
835
|
+
},
|
|
836
|
+
"markdown_to_html": {
|
|
837
|
+
"type": "object",
|
|
838
|
+
"title": "markdown_to_html",
|
|
839
|
+
"description": "Convert Markdown to HTML (Kramdown) and sanitize the result. Often chained after `template`.",
|
|
840
|
+
"examples": [
|
|
841
|
+
{
|
|
842
|
+
"name": "markdown_to_html"
|
|
843
|
+
}
|
|
844
|
+
],
|
|
845
|
+
"properties": {
|
|
846
|
+
"name": {
|
|
847
|
+
"type": "string",
|
|
848
|
+
"const": "markdown_to_html"
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
"required": [
|
|
852
|
+
"name"
|
|
853
|
+
],
|
|
854
|
+
"additionalProperties": true
|
|
855
|
+
},
|
|
856
|
+
"parse_time": {
|
|
857
|
+
"type": "object",
|
|
858
|
+
"title": "parse_time",
|
|
859
|
+
"description": "Parse a time string with Time.parse and return RFC822, using the channel `time_zone`.",
|
|
860
|
+
"examples": [
|
|
861
|
+
{
|
|
862
|
+
"name": "parse_time"
|
|
863
|
+
}
|
|
864
|
+
],
|
|
865
|
+
"properties": {
|
|
866
|
+
"name": {
|
|
867
|
+
"type": "string",
|
|
868
|
+
"const": "parse_time"
|
|
869
|
+
}
|
|
870
|
+
},
|
|
871
|
+
"required": [
|
|
872
|
+
"name"
|
|
873
|
+
],
|
|
874
|
+
"additionalProperties": true
|
|
875
|
+
},
|
|
876
|
+
"parse_uri": {
|
|
877
|
+
"type": "object",
|
|
878
|
+
"title": "parse_uri",
|
|
879
|
+
"description": "Normalize a URL string; resolve relative URLs against the channel URL.",
|
|
880
|
+
"examples": [
|
|
881
|
+
{
|
|
882
|
+
"name": "parse_uri"
|
|
883
|
+
}
|
|
884
|
+
],
|
|
885
|
+
"properties": {
|
|
886
|
+
"name": {
|
|
887
|
+
"type": "string",
|
|
888
|
+
"const": "parse_uri"
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
"required": [
|
|
892
|
+
"name"
|
|
893
|
+
],
|
|
894
|
+
"additionalProperties": true
|
|
895
|
+
},
|
|
896
|
+
"sanitize_html": {
|
|
897
|
+
"type": "object",
|
|
898
|
+
"title": "sanitize_html",
|
|
899
|
+
"description": "Sanitize HTML (sanitize gem RELAXED plus html2rss defaults: absolute URLs, safe link/img attributes, wrap lone images in anchors).",
|
|
900
|
+
"examples": [
|
|
901
|
+
{
|
|
902
|
+
"name": "sanitize_html"
|
|
903
|
+
}
|
|
904
|
+
],
|
|
905
|
+
"properties": {
|
|
906
|
+
"name": {
|
|
907
|
+
"type": "string",
|
|
908
|
+
"const": "sanitize_html"
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
"required": [
|
|
912
|
+
"name"
|
|
913
|
+
],
|
|
914
|
+
"additionalProperties": true
|
|
915
|
+
},
|
|
916
|
+
"substring": {
|
|
917
|
+
"type": "object",
|
|
918
|
+
"title": "substring",
|
|
919
|
+
"description": "Return a slice of the extracted string using Integer `start` and optional `end` (Ruby String#[] range semantics; end may be omitted).",
|
|
920
|
+
"examples": [
|
|
921
|
+
{
|
|
922
|
+
"name": "substring",
|
|
923
|
+
"start": 4,
|
|
924
|
+
"end": 6
|
|
925
|
+
}
|
|
926
|
+
],
|
|
927
|
+
"properties": {
|
|
928
|
+
"name": {
|
|
929
|
+
"type": "string",
|
|
930
|
+
"const": "substring"
|
|
931
|
+
},
|
|
932
|
+
"start": {
|
|
933
|
+
"type": "integer"
|
|
934
|
+
},
|
|
935
|
+
"end": {
|
|
936
|
+
"type": "integer"
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
"required": [
|
|
940
|
+
"name",
|
|
941
|
+
"start"
|
|
942
|
+
],
|
|
943
|
+
"additionalProperties": true
|
|
944
|
+
},
|
|
945
|
+
"template": {
|
|
946
|
+
"type": "object",
|
|
947
|
+
"title": "template",
|
|
948
|
+
"description": "Format a string with Kernel#format-style placeholders (`%{key}` / `%<key>s`). `%{self}` is the current selector value; other keys resolve sibling selectors.",
|
|
949
|
+
"examples": [
|
|
950
|
+
{
|
|
951
|
+
"name": "template",
|
|
952
|
+
"string": "`%{self}` (`%{price}`)"
|
|
953
|
+
}
|
|
954
|
+
],
|
|
955
|
+
"properties": {
|
|
956
|
+
"name": {
|
|
957
|
+
"type": "string",
|
|
958
|
+
"const": "template"
|
|
959
|
+
},
|
|
960
|
+
"string": {
|
|
961
|
+
"type": "string"
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
"required": [
|
|
965
|
+
"name",
|
|
966
|
+
"string"
|
|
967
|
+
],
|
|
968
|
+
"additionalProperties": true
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
"extractors": {
|
|
972
|
+
"attribute": {
|
|
973
|
+
"type": "string",
|
|
974
|
+
"const": "attribute",
|
|
975
|
+
"title": "attribute",
|
|
976
|
+
"description": "Return the value of an HTML attribute on the selected element. Requires sibling selector option `attribute` (attribute name).",
|
|
977
|
+
"examples": [
|
|
978
|
+
"attribute"
|
|
979
|
+
]
|
|
980
|
+
},
|
|
981
|
+
"href": {
|
|
982
|
+
"type": "string",
|
|
983
|
+
"const": "href",
|
|
984
|
+
"title": "href",
|
|
985
|
+
"description": "Return the absolute URL from the selected element's `href` attribute (relative hrefs are resolved against the channel URL).",
|
|
986
|
+
"examples": [
|
|
987
|
+
"href"
|
|
988
|
+
]
|
|
989
|
+
},
|
|
990
|
+
"html": {
|
|
991
|
+
"type": "string",
|
|
992
|
+
"const": "html",
|
|
993
|
+
"title": "html",
|
|
994
|
+
"description": "Return the outer HTML of the selected element. Sanitize during post-processing (e.g. `sanitize_html`).",
|
|
995
|
+
"examples": [
|
|
996
|
+
"html"
|
|
997
|
+
]
|
|
998
|
+
},
|
|
999
|
+
"static": {
|
|
1000
|
+
"type": "string",
|
|
1001
|
+
"const": "static",
|
|
1002
|
+
"title": "static",
|
|
1003
|
+
"description": "Return a fixed value from sibling selector option `static` (no DOM read).",
|
|
1004
|
+
"examples": [
|
|
1005
|
+
"static"
|
|
1006
|
+
]
|
|
1007
|
+
},
|
|
1008
|
+
"text": {
|
|
1009
|
+
"type": "string",
|
|
1010
|
+
"const": "text",
|
|
1011
|
+
"title": "text",
|
|
1012
|
+
"description": "Return collapsed visible text of the selected element (default extractor).",
|
|
1013
|
+
"examples": [
|
|
1014
|
+
"text"
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
696
1019
|
}
|