TINE Docs
GitHub
  • Highlights
  • TINE
    • Install
  • GETTING STARTED
    • Quick start
    • Concept
      • Multiple Inlets and Outlets
      • Merge Records
      • Pipeline as Http Handler
    • Log config
  • Embedding TINE in Go
    • Use Recipe
    • Use API
  • Plugins
    • Inlets
    • Flows
    • Outlets
    • Extras
  • RECIPES
    • QRCode Generator
    • OLLAMA
    • OLLAMA Telegram Bot
    • Web Page Snapshot
    • Syslog Receiver
    • SQLite
    • RRD
Powered by GitBook
On this page
  • Static Target Recipe
  • User Input Recipe
Edit on GitHub
  1. RECIPES

Web Page Snapshot

The chrome_snap plugin relies on having Google Chrome browser installed beforehand.

The following recipe demonstrates how to capture two web pages and save them as image files using the chrome_snap plugin.

Static Target Recipe

example.toml

#[log]
#    path = "-"
#    level = "debug"
[[inlets.file]]
    data = [
        '{"url":"https://tine.thingsme.xyz", "dst_path":"./chrome_snap_tine_docs.png"}', 
        '{"url":"https://github.com/OutOfBedlam/tine", "dst_path":"./chrome_snap_tine_github.png"}', 
    ]
    format = "json"
[[flows.chrome_snap]]
    url_field = "url"
    out_field = "snap"
    timeout = "15s"
[[outlets.image]]
    path_field = "dst_path"
    image_fields = ["snap"]
    overwrite = true

Run

$ ./tine run ./example.toml

Output

User Input Recipe

example.toml

#!/path/to/tine run

#[log]
#    path = "-"
#    level = "info"
[[inlets.args]]
[[flows.chrome_snap]]
    url_field = "url"
    out_field = "snap"
    timeout = "15s"
[[outlets.image]]
    path_field = "out"
    image_fields = ["snap"]
    overwrite = true

Run

$ chmod +x example.toml

$ ./example.toml -- url=https://github.com out=./out.png

$ ls -l out.png
PreviousOLLAMA Telegram BotNextSyslog Receiver

Last updated 10 months ago

chrome_snap_tine_docs.png
chrome_snap_tine_github.png