Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SwiftBlogs.dev is a project, that collects all Swift blogs and allows easy searches through the whole Swift universe. 🌌 🔭

SwiftBlogs - API

This repo contains a Vapor backend, which crawls the feeds repository and saves feeds, blog posts and authors in a database.

This project also uses the iOSDevDirectory from Dave Verwer. 🙏

Project Status

  • save feeds in database job
  • feed crawling job
  • feeds endpoints
  • posts endpoints
  • authors endpoints
  • search definition & endpoint

Endpoints

Please feel free to add suggestions for new endpoints, if something is missing. These endpoints will be available at api.swiftblogs.dev.

Feeds

Get all feeds:

GET /v1/feeds
[
    {
        "feed": "https://www.swiftbysundell.com/rss",
        "lastCrawl": "2019-12-26T21:16:00Z",
        "id": 1
    },
    {
        "feed": "https://www.swiftbysundell.com/podcast/rss",
        "lastCrawl": "2019-12-26T21:17:00Z",
        "id": 2
    },
    {...}
]

Get feed with id 1:

GET /v1/feeds/1
{
    "feed": "https://www.swiftbysundell.com/rss",
    "lastCrawl": "2019-12-26T21:16:00Z",
    "id": 1
}

Posts

Get post with id 7:

GET /v1/posts/7
{
  "feedId" : 7,
  "datePublished" : 566611200,
  "lastCrawl" : 599158440.63413,
  "id" : 21,
  "authorId" : 20,
  "title" : "StringInterpolation in Swift 5 — AttributedStrings",
  "description" : "\n          \n          <p>In <a href=\"\/swift\/2018\/12\/15\/swift5-stringinterpolation-part1\/\">the previous post<\/a>, we introduced the new StringInterpolation design coming to Swift 5. In this second part, I’ll focus on one application of that new <code class",
  "url" : "https:\/\/alisoftware.github.io\/swift\/2018\/12\/16\/swift5-stringinterpolation-part2\/"
}

Get all posts from October 2019 (e.g. 10-2019):

GET /v1/posts/year/2019/month/10
[
  {
    "feedId" : 11,
    "datePublished" : 591580800,
    "lastCrawl" : 599158681.16415906,
    "id" : 61,
    "authorId" : 8,
    "title" : "Race Report: Berlin Marathon",
    "description" : "<p>In 2015, I ran the Berlin Marathon in just under three hours: 2:59:41. It was my fourth attempt at the marathon. Even though I hit the wall at km 34, I had run the first bit fast enough to still make it under three hours. Before the race, I believed I ",
    "url" : "http:\/\/chris.eidhof.nl\/post\/race-report-berlin-marathon\/"
  },
  {
    "feedId" : 12,
    "datePublished" : 592264370,
    "lastCrawl" : 599158740.93187404,
    "id" : 200,
    "authorId" : 2,
    "title" : "A simple HTTP\/2 server using Vapor 4",
    "description" : "Get started with server-side Swift using the Vapor 4 framework. Learn how to build a really simple HTTP\/2 backend server. ",
    "url" : "https:\/\/theswiftdev.com\/2019\/10\/08\/a-simple-http2-server-using-vapor-4\/"
  },
  {...}
]

Authors

Get all authors:

GET /v1/authors
[
  {
    "id" : 1,
    "name" : "Jake Marsh",
    "url" : "https:\/\/twitter.com\/jakemarsh"
  },
  {
    "id" : 2,
    "name" : "Tibor Bödecs",
    "url" : "https:\/\/twitter.com\/tiborbodecs"
  },
  {...}
]

Get author with id 6:

GET /v1/authors/6
{
  "id" : 6,
  "name" : "Bas Broek",
  "url" : "https:\/\/twitter.com\/basthomas"
}
You can’t perform that action at this time.