Coder Social home page Coder Social logo

luxas / speakerdeck-api Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 45 KB

A scraper implementation for Speakerdeck, as a workaround due to the lack of an official API

License: MIT License

Makefile 0.42% Go 99.58%
speakerdeck api go scraper geocoding public-speaking slides

speakerdeck-api's Introduction

speakerdeck-api

A scraper implementation for SpeakerDeck, as a workaround due to the lack of an official API.

You can either use this as a library (import speakerdeck "github.com/luxas/speakerdeck-api") or the ready-made (very lightweight) API implementation under cmd/speakerdeck-api.

API Usage

Install and start the API:

$ go get github.com/luxas/speakerdeck-api/cmd/speakerdeck-api
$ $GOPATH/bin/speakerdeck-api
INFO[0000] Starting Speakerdeck API...

Get information about a user:

curl http://localhost:8080/api/users/luxas
{
  "author": {
    "name": "Lucas Käldström",
    "handle": "luxas",
    "link": "https://speakerdeck.com/luxas",
    "avatarLink": "https://secure.gravatar.com/avatar/111ac0b31c0dc219c84ddadedc8e5f67?s=128"
  },
  "abstract": "Lucas is a cloud native enthusiast who has been serving the Kubernetes \u0026 CNCF communities in lead positions for more than 4 years. Lucas is a CNCF Ambassador, running 3 meetup groups in Finland and coordinating the Cloud Native Nordics meetups. He got the \"Top Cloud Native Ambassador\" award together with Sarah Novotny 2017. Lucas has e.g. shepherded kubeadm from inception to GA as a co-lead for SIG Cluster Lifecycle, ported Kubernetes to Raspberry Pi and multiple other platforms. Lucas is a CKA, runs a consulting company \"luxas labs\" for cloud native tech and has spoken at six KubeCons.",
  "talkPreviews": [
    ...,
    {
      "title": "Getting Started in the Kubernetes Community",
      "id": "getting-started-in-the-kubernetes-community",
      "views": 92,
      "stars": 1,
      "date": "2019-05-21T00:00:00Z",
      "link": "https://speakerdeck.com/luxas/getting-started-in-the-kubernetes-community",
      "dataID": "6816e10f104a44cebb0915b392cadd2d"
    },
    ...,
  ]
}

Get detailed information about a user's talks (all of them):

curl http://localhost:8080/api/talks/luxas
[
  ...,
  {
    "title": "Getting Started in the Kubernetes Community",
    "id": "getting-started-in-the-kubernetes-community",
    "views": 92,
    "stars": 1,
    "date": "2019-05-21T00:00:00Z",
    "link": "https://speakerdeck.com/luxas/getting-started-in-the-kubernetes-community",
    "dataID": "6816e10f104a44cebb0915b392cadd2d",
    "author": {
      "name": "Lucas Käldström",
      "handle": "luxas",
      "link": "https://speakerdeck.com/luxas",
      "avatarLink": "https://secure.gravatar.com/avatar/111ac0b31c0dc219c84ddadedc8e5f67?s=47"
    },
    "category": "Technology",
    "categoryLink": "https://speakerdeck.com/c/technology",
    "downloadLink": "https://speakerd.s3.amazonaws.com/presentations/6816e10f104a44cebb0915b392cadd2d/Lucas_Kaldstrom-Nikhita_Raghunath_-_May_21_-_Morning.pdf",
    "extraLinks": {
      "github.com": [
        "https://github.com/nikhita"
      ]
    },
    "hide": false
  },
  ...,
]

Get detailed information about one of the user's talks:

curl http://localhost:8080/api/talks/luxas/getting-started-in-the-kubernetes-community
[
  {
    "title": "Getting Started in the Kubernetes Community",
    "id": "getting-started-in-the-kubernetes-community",
    "views": 92,
    "stars": 1,
    "date": "2019-05-21T00:00:00Z",
    "link": "https://speakerdeck.com/luxas/getting-started-in-the-kubernetes-community",
    "dataID": "6816e10f104a44cebb0915b392cadd2d",
    "author": {
      "name": "Lucas Käldström",
      "handle": "luxas",
      "link": "https://speakerdeck.com/luxas",
      "avatarLink": "https://secure.gravatar.com/avatar/111ac0b31c0dc219c84ddadedc8e5f67?s=47"
    },
    "category": "Technology",
    "categoryLink": "https://speakerdeck.com/c/technology",
    "downloadLink": "https://speakerd.s3.amazonaws.com/presentations/6816e10f104a44cebb0915b392cadd2d/Lucas_Kaldstrom-Nikhita_Raghunath_-_May_21_-_Morning.pdf",
    "extraLinks": {
      "github.com": [
        "https://github.com/nikhita"
      ]
    },
    "hide": false
  }
]

For reference you can visit https://speakerdeck.com/luxas/getting-started-in-the-kubernetes-community to check where the data is coming from.

Geolocation

speakerdeck-api also has support for extensions, the extension that currently exists is LocationExtension (in ./location), which can using a Google Maps API key (with access to the Geocoding API) geolocate your talks just by you putting Location: <address> in the Speakerdeck talk description!

Enable it by giving the Google Maps key to the API:

$GOPATH/bin/speakerdeck-api -maps-api-key <API_KEY>

Now, notice the location field which is generated based on the Location: Fira Gran Via, Av. Joan Carles I, Barcelona, Spain string embedded in the talk description:

curl http://localhost:8080/api/talks/luxas/getting-started-in-the-kubernetes-community
[
  {
    "title": "Getting Started in the Kubernetes Community",
    "id": "getting-started-in-the-kubernetes-community",
    "views": 92,
    "stars": 1,
    "date": "2019-05-21T00:00:00Z",
    "link": "https://speakerdeck.com/luxas/getting-started-in-the-kubernetes-community",
    "dataID": "6816e10f104a44cebb0915b392cadd2d",
    "author": {
      "name": "Lucas Käldström",
      "handle": "luxas",
      "link": "https://speakerdeck.com/luxas",
      "avatarLink": "https://secure.gravatar.com/avatar/111ac0b31c0dc219c84ddadedc8e5f67?s=47"
    },
    "category": "Technology",
    "categoryLink": "https://speakerdeck.com/c/technology",
    "downloadLink": "https://speakerd.s3.amazonaws.com/presentations/6816e10f104a44cebb0915b392cadd2d/Lucas_Kaldstrom-Nikhita_Raghunath_-_May_21_-_Morning.pdf",
    "extraLinks": {
      "github.com": [
        "https://github.com/nikhita"
      ]
    },
    "hide": false,
    "location": {
      "requestedAddress": "Fira Gran Via, Av. Joan Carles I, Barcelona, Spain",
      "resolvedAddress": "Av. Joan Carles I, 64, 08908 L'Hospitalet de Llobregat, Barcelona, Spain",
      "lat": 41.3546878,
      "lng": 2.1277339
    }
  }
]

Library Usage

Check out the documentation on Godoc or pkg.go.dev!

License

MIT

speakerdeck-api's People

Contributors

luxas avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

fkshom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.