A Simple API to collect Blog Posts from moroccan developers Community.
This Project is based on blogs RSS feeds.
we are combining RSS feeds from
awesome-morocco blogs section
To add your posts, Make sure to add your Blog to
awesome-morocco
blogs with a valid RSS feed.
=> https://moroccan-blog-posts-api.netlify.app/demo
Get Latest Blog Posts
const API = "https://moroccan-blog-posts-api.netlify.app/";
try {
const data = await fetch(API);
const feed = await data.json();
} catch (error) {
console.log(error);
}
Result :
{
"total_count": 120,
"lastUpdate": "2020-07-14T22:47:02.713Z",
"posts": [
{
"title": "The green presence dot",
"creator": "Ahmed",
"date": "6/29/2020",
"link": "https://elazzabi.com/2020/06/29/,the-green-presence-dot/"
}
]
}
total_count
: Total number of blog posts we have in the database (not really)
lastUpdate
: Last time we fetched RSS feeds
- The API will return the latest 20 posts by default.
- You can use
offset
andlimit
to fetch more
const data = await fetch(`${API}?offset=10&limit=20`);