npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pietsmiet-api

v0.2.0

Published

A wrapper around the (unofficial) PietSmiet.de API. pls dont sue!

Downloads

4

Readme

pietsmiet-api

Version Downloads/week License

An (unofficial) wrapper around the pietsmiet.de API.

Installation

npm install pietsmiet-api

Usage

Note: API requests are signed by a custom request header called x-origin-integrity. I have reverse-engineered the generation, but as this is meant to prevent abuse, its not implemented directly in this module.

Setup: Visit pietsmiet.de and inspect any (api-)request with the browser dev-tools. Copy the value for x-origin-integrity and use to initialize your PietSmietApi instance.

Constructor expects argument of type initConfig.

import PietSmietApi from "pietsmiet-api";

const API = new PietSmietApi({
  userAgent: "", // insert your User-Agent (might be optional)
  integrity: "", // insert (your) current x-origin-integrity
});

Endpoints:

This will be updated with more granular information soon(ish)!

.getVideos()

Used to access published videos. Expects argument of type contentRequest.

API.getVideos({
  page: "1",
  limit: "10",
  order: "latest",
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

.getPlaylists()

Used to access published playlists. Expects argument of type contentRequest.

API.getPlaylists({
  page: "1",
  limit: "10",
  order: "latest",
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

.getClips()

Used to access published clips. Expects argument of type contentRequest.

API.getClips({
  page: "1",
  limit: "10",
  order: "latest",
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

.getPodcasts()

Used to access published podcasts. Expects argument of type contentRequest.

API.getPodcasts({
  page: "1",
  limit: "10",
  order: "latest",
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

.getChannels()

Used to access channels. Expects argument of type contentRequest.

API.getChannels({
  page: "1",
  limit: "10",
  order: "latest",
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

.getAuthors()

Used to access authors.

API.getAuthors()
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

.getNews()

Used to access published news. Expects argument of type contentRequest.

API.getNews({
  page: "1",
  limit: "10",
  order: "latest",
})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

Types:

initConfig

type initConfig = {
  userAgent: string; // e.g. "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"; (might be optional)
  integrity: string; // e.g. "3f3749c0";
};

contentRequest

type contentRequest = {
  page: string; // pagination offset. Can be derived from last response.
  limit: string; // limit results. Maximum is 500.
  order: string; // choose what to sort the results by. Supported options: <latest/oldest/popular/trending>
  channels?: string; // optional argument for getVideos() method. Limit search to specific channel. <8(Frag Pietsmiet)/9(pietmiet)/10(Pietsmiet TV)/12(Best of Pietsmiet)/37(PietsmietDE)/44(Streams)>
};

Build

git clone https://github.com/maxboettinger/pietsmiet-api.git
cd pietsmiet-api
npm i
npm run local