byted-link-reader

Original🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected

Use the built-in link_reader function to read content from web pages, PDFs, or Douyin videos. Prepare a list of URLs. Run the script `python scripts/link_reader.py "url1" "url2" ...`.

8installs
Added on

NPX Install

npx skill4agent add bytedance/agentkit-samples byted-link-reader

SKILL.md Content (Chinese)

View Translation Comparison →

BytedLinkReader

Application Scenarios

Use this skill to call the
link_reader
function when you need to obtain the title and body content of web pages, PDFs, or Douyin videos.

Authentication and Credential Sources

  • When a user uses this skill for the first time, first check if the
    ARK_API_KEY
    and
    MODEL_AGENT_API_KEY
    environment variables are configured. If not configured, prompt the user to provide
    ARK_API_KEY
    , and write it to the environment variable file under the workspace. If the file already exists, append it to the end, ensure the environment variable format is correct, and make this environment variable take effect.
  • This skill uses the
    ARK_API_KEY
    environment variable by default.
  • If not configured, it will try to use the
    MODEL_AGENT_API_KEY
    environment variable.

Usage Steps

  1. Prepare a list of URLs.
  2. Run the script
    python scripts/link_reader.py "url1" "url2" ...
    . cd to the corresponding directory before running.
  3. The returned result includes the title and content corresponding to each URL.

Output Format

  • A list in JSON format, where each element contains the title and content corresponding to the URL.

Error Handling

  • If the error 'PermissionError: ARK_API_KEY or MODEL_AGENT_API_KEY is not set in environment variables.' occurs, prompt the user to provide
    ARK_API_KEY
    or
    MODEL_AGENT_API_KEY
    , write them to the environment variable file under the workspace. If the file already exists, append it to the end, ensure the environment variable format is correct, make this environment variable take effect, and retry the failed read operation.
  • When using this skill again, prioritize reading
    ARK_API_KEY
    or
    MODEL_AGENT_API_KEY
    from environment variables.

Example

bash
python scripts/link_reader.py "https://example.com"