FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
thejeshgn

thejeshgn

cap_feeds_india

Public
Like
cap_feeds_india
Home
Code
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://thejeshgn--67a0efc03ad411f084059e149126039e.web.val.run
README.md

Kerala NDMA RSS Feed API

A CORS-enabled HTTP endpoint that fetches and parses the Kerala NDMA (National Disaster Management Authority) RSS feed for weather alerts and disaster warnings.

Features

  • ✅ CORS enabled for cross-origin requests
  • ✅ Fetches real-time data from Kerala NDMA RSS feed
  • ✅ Parses XML and returns structured JSON
  • ✅ Error handling with proper HTTP status codes
  • ✅ Includes metadata like fetch timestamp and item count

API Endpoint

GET /

Response Format

{ "channel": { "title": "Kerala NDMA RSS Feed", "description": "", "link": "https://sachet.ndma.gov.in/cap_public_website/rss/rss_kerala.xml" }, "items": [ { "title": "Weather alert title", "description": "Alert description (if available)", "link": "Link to detailed alert", "pubDate": "Publication date", "guid": "Unique identifier (if available)" } ], "totalItems": 52, "fetchedAt": "2025-05-27T08:27:27.958Z" }

CORS Headers

The API includes the following CORS headers:

  • Access-Control-Allow-Origin: *
  • Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
  • Access-Control-Allow-Headers: Content-Type, Authorization

Error Handling

If the RSS feed is unavailable or there's a parsing error, the API returns:

{ "error": "Failed to fetch RSS feed", "message": "Detailed error message" }

Data Source

This API fetches data from: https://sachet.ndma.gov.in/cap_public_website/rss/rss_kerala.xml

The RSS feed contains weather alerts, disaster warnings, and emergency notifications for Kerala state in India, published by the National Disaster Management Authority.

Usage Examples

JavaScript/Fetch

fetch('https://your-val-town-url.web.val.run/') .then(response => response.json()) .then(data => { console.log(`Found ${data.totalItems} alerts`); data.items.forEach(item => { console.log(item.title); }); });

cURL

curl -X GET https://your-val-town-url.web.val.run/

Implementation Details

  • Built with TypeScript for Val Town
  • Simple XML parsing using regex (no external dependencies)
  • Handles both CDATA and regular text content
  • Supports preflight OPTIONS requests for CORS
  • Returns proper HTTP status codes (200 for success, 500 for errors)
HTTP
  • index.ts
    thejeshgn--67…9e.web.val.run
Code
README.md
H
index.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.