XKCD

fetch-current-comic@0.0.0
Supported by 1 provider
X

FetchCurrentComic

Result
alt
day
img
link
month
news
num
safeTitle
title
transcript
year

1.Choose a provider

2.Use FetchCurrentComic with xkcd in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('fetch-current-comic@0.0.0');

  // Use the profile
  const result = await profile
    .getUseCase('FetchCurrentComic')
    .perform({}, {
      provider: 'xkcd',
      mapVariant: 'generated'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Result (object)

alt
day
img
link
month
news
num
safeTitle
title
transcript
year

Example

{
  "alt": "",
  "day": "",
  "img": "",
  "link": "",
  "month": "",
  "news": "",
  "num": 42,
  "safeTitle": "",
  "title": "",
  "transcript": "",
  "year": ""
}

Implementation details

Provider
xkcd
Use case
FetchCurrentComic
Author
@superface
Source
Verified