Skip to content

404missinglink/HF-Daily-Papers-Feeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hugging Face Papers RSS Feed

A serverless RSS feed for papers published on Hugging Face's papers page. This service scrapes the papers page daily and generates an RSS feed that can be consumed by any RSS reader.

Inspired by James (@capjamesg)'s Hugging Face Papers RSS Feed.

Features

  • Serverless deployment on Vercel
  • Redis caching to minimize scraping
  • Daily automatic updates via cron job
  • Clean RSS feed with paper titles, links and abstracts
  • Health check and status endpoints
  • CORS enabled for cross-origin requests

Deployment

Prerequisites

  • A Vercel account
  • A Redis database (e.g. Upstash)
  • Go 1.x installed locally for development

Deploy to Vercel

  1. Fork this repository

  2. Create a new project on Vercel and import your forked repository

  3. Set up the following environment variables in your Vercel project settings:

KV_URL=your_redis_url
KV_REST_API_TOKEN=your_redis_write_token  
KV_REST_API_READ_ONLY_TOKEN=your_redis_read_token
KV_REST_API_URL=your_redis_rest_api_url
  1. Deploy! Vercel will automatically build and deploy your RSS feed service

The feed will be available at: https://your-project.vercel.app/api/feed

Local Development

  1. Clone the repository:
git clone https://github.com/yourusername/daily-papers.git
cd daily-papers
  1. Create a .env file in the root directory with your Redis credentials:
KV_URL=your_redis_url
KV_REST_API_TOKEN=your_redis_write_token
KV_REST_API_READ_ONLY_TOKEN=your_redis_read_token
KV_REST_API_URL=your_redis_rest_api_url
  1. Run the development server:
vercel dev

The local server will be available at http://localhost:3000

API Endpoints

  • /api - Health check and status
  • /api/feed - RSS feed of papers
  • /api/update-cache - Manually trigger feed update (requires authentication)

Manual Cache Updates

To enable secure manual cache updates, you need to set an UPDATE_KEY environment variable:

  1. Add to your Vercel environment variables:
UPDATE_KEY=your_secret_key_here  # Use a secure random string
  1. To manually trigger a cache update, use the following curl command:
curl -X GET \
  https://your-project.vercel.app/api/update-cache \
  -H 'X-Update-Key: your_secret_key_here'

Successful response:

{
  "status": "Cache updated successfully",
  "timestamp": "2024-03-20T15:30:45Z"
}

Example Response

Health check (/api):

{
  "status": "ok",
  "endpoints": ["/api/feed"],
  "cache_status": true,
  "timestamp": "2024-03-20T15:30:45Z",
  "version": "1.0.0"
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

About

A serverless RSS feed for HuggingFace's Daily Papers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages