SuperAPI AI Directory

link-reader

General & other

View repository

Updated 10-15 17:30

About this skill

Link Reader

Use cases

When you need to obtain the title and body content of a web page, PDF, or Douyin video, use this skill to call the link_reader function.

Authentication and credential sources

  • When a user uses this skill for the first time, first check whetherARK_API_KEYandMODEL_AGENT_API_KEYenvironment variables are configured. If not configured, prompt the user that they need to provideARK_API_KEY, and write it to the environment variables 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 URL list.
  2. Run the script python scripts/link_reader.py "url1" "url2" .... Before running, cd to the corresponding directory.
  3. The returned result contains the title and content of each URL.

Output format

  • A list in JSON format, where each element contains the title and content corresponding to a 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 that they need to provideARK_API_KEYorMODEL_AGENT_API_KEY, and write them to the environment variables file under the workspace. If the file already exists, append them to the end, ensure the environment variable format is correct, make this environment variable take effect, and retry the read that just failed.
  • When using this skill again, prioritize reading from the environment variablesARK_API_KEYorMODEL_AGENT_API_KEY

Example

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