编程

Astroph Arxiv Skill Repo

试用

Embed the Python script directly into the skill for robust and reproducible XML parsing.

它能做什么

Embed the Python script directly into the skill for robust and reproducible XML parsing.

技能文档

Astro-ph Radar Runbook

When the user requests a literature search for a specific topic, execute these steps strictly:

  1. Construct the Query:

    • Base URL: https://export.arxiv.org/api/query
    • Crucial arXiv API Quirk: Combining the top-level cat:astro-ph with keywords and sortBy=submittedDate breaks the API's sorting and returns old papers (e.g., from 2008). To get truly recent papers, you MUST use a subcategory like cat:astro-ph.GA (Galactic Astrophysics), cat:astro-ph.SR, etc., or omit the cat: filter if the query is already specific enough.
    • Cost-Control Limit: Identify the number of papers requested by the user. If the user does not specify a number, default strictly to max_results=2. NEVER exceed the requested limit.
    • Combine parameters: ?search_query=cat:astro-ph.GA+AND+all:""&sortBy=submittedDate&sortOrder=descending&max_results=
    • Ensure spaces and quotes are URL-encoded (e.g., %20AND%20).
  2. Execute Fetch and Parse:

    • Instead of using pure bash tools, create and run the following Python script (e.g., parse_arxiv.py) to fetch, parse, and format the XML data perfectly. It ensures correct highlighting and formatting.
import urllib.request
import xml.etree.ElementTree as ET
import re
import sys

# Inject the exact URL constructed in Step 1 here
URL = "YOUR_CONSTRUCTED_URL_HERE"

def highlight(text):
    words_to_bold = [
        "Gaia", "VVV", "VVVX", "H.E.S.S.", "ACS", "MACHO", "SEKBO", 
        "metallicity", "decontamination", "maximum likelihood",
        "spectroscopy", "photometry", "kinematics", "proper-motion"
    ]
    for w in words_to_bold:
        pattern = re.compile(re.escape(w), re.IGNORECASE)
        text = pattern.sub(lambda m: f"**{m.group(0)}**", text)
    return text

try:
    req = urllib.request.Request(URL, headers={'User-Agent': 'Mozilla/5.0'})
    with urllib.request.urlopen(req) as response:
        xml_data = response.read()
except Exception as e:
    print(f"Error fetching data: {e}")
    sys.exit(1)

root = ET.fromstring(xml_data)
ns = {'atom': 'http://www.w3.org/2005/Atom'}

count = 0
for entry in root.findall('atom:entry', ns):
    title_el = entry.find('atom:title', ns)
    if title_el is None or title_el.text == 'Error':
        continue
        
    title = title_el.text.replace('\n', ' ').strip()
    
    authors = [author.find('atom:name', ns).text for author in entry.findall('atom:author', ns)]
    author_str = f"{authors[0]}, {authors[1]}, {authors[2]}, {authors[3]} et al." if len(authors) > 4 else ", ".join(authors)
        
    published = entry.find('atom:published', ns).text[:10]
    
    summary = highlight(entry.find('atom:summary', ns).text.replace('\n', ' ').strip())
    
    link_abs = entry.find('atom:id', ns).text
    link_pdf = link_abs.replace('/abs/', '/pdf/') + ".pdf"
    
    print(f"**{title}**")
    print(f"**Authors:** {author_str}")
    print(f"**Date:** {published}")
    print(f"**Links:** [Abstract]({link_abs}) | [PDF]({link_pdf})")
    print(f"> {summary}\n\n---")
    count += 1

print(f"Found {count} papers.")
  1. Output the Results:
    • Display the standard output generated by the script to the user. It will already be correctly formatted according to the Strict Academic Format.

相关技能

Queries arXiv filtering by astro-ph, extracting full abstracts, authors, and PDF links. Embeds the Python script directly into the skill for robust and repro...

1 次安装1 星标

This skill helps users run the arXiv Papers Search Scraper BrowserAct template and extract structured public data. Use this skill when users ask to collect arxiv papers search scraper data, scrape arxiv papers search scraper results, monitor public records from this source, export structured records

1 次安装

Convert a book, paper, document, documentation site, or code repository into a structured, on-demand agent skill. Use when the user wants to turn a PDF, EPUB, DOCX, a URL, a docs site, or a GitHub repo into a skill they can load later — "make a skill from this book", "turn this paper into a skill", "turn these docs into a skill", "I want an agent that knows this library".

3 次安装

由模型规划查询并判断相关性,将多轮 arXiv 结果合并去重,最终产出可直接使用的主题论文集。

98 次安装

Search arxiv for latest papers by keyword and generate a structured daily report.

4 次安装

为单篇或一批 ArXiv 论文下载源文件与 PDF,再通读全文并按指定语言生成结构化的 summary.md。

116 次安装1 星标