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

cms_sekolahku_api

v1.0.6-2a

Published

Access to public online assets of your school's website using this API!

Downloads

8

Readme

CMS Sekolahku API

If your school has a website that is powered using CMS Sekolahku (especially in Indonesia), you can get every* online public data on the website using this API!

You can get current post feed (Newest posts)

const api = require('cms_sekolahku_api');
const school = new api.BaseAPI("https://cms.sekolahku.web.id/")

school.posts.feed().then((response) => {
    console.log(response)
})

or even, post a comment!

const api = require('cms_sekolahku_api');
const school = new api.BaseAPI("https://cms.sekolahku.web.id/")

school.comments.postComment(69, "mukeenanyafiq", "[email protected]", "https://example.com", "Merdeka!").then((response) => {
    // Checks if the comment were successfully posted
    console.log(response.status)
})

Currently, this module includes:

  • getting post feed;
  • getting posts by category, tag, and archives;
  • getting comments on a post;
  • post a comment;
  • gets a gallery of photos and videos, also previewing them;
  • gets all student information;
  • .. alumni;
  • .. employees;
  • .. opening speech;
  • .. subscribing for the latest posts;
  • .. voting in the latest polls;
  • .. and a list of available downloadable files

URL Path

This module uses a specific URL path to obtain information from your school's website and then parsing it into something readable. You can use these URL paths (by continuing from the base url) instead if you want the cheapest way

  • [H] means the data needs another header for the data that were sent to return "success" status

Data that will not included in the original URL path

  • post_url & post_comment_count element (from PostRows)
  • photo_url element (from GalleryAlbumInformation)
  • url element (from GalleryVideoInformation)

Required Headers for POST Requests

  • "Content-Type": "application/x-www-form-urlencoded"
  • "x-requested-with": "XMLHttpRequest"

| Origin Function | URL Path | Methods | Data to send | Returns | | --------------- | -------- | ------- | ------------ | ------- | | Posts.feed() | /feed | GET | | XHR | | Posts.getPostsByCategories() | /public/post_categories/get_posts | POST | { "page_number": number, "category_slug": string } | JSON | | Posts.getPostsByTags() | /public/post_tags/get_posts | POST | { "page_number": number, "tag": string } | JSON | | Posts.getPostsByArchives() | /public/archives/get_posts | POST | { "page_number": number, "year": string, "month": string } | JSON | | Comments.getPostComments() | /public/post_comments/get_post_comments | POST | { "page_number": number, "comment_post_id": number } | JSON | | Comments.postComment() | /public/post_comments | POST | { "comment_author": author, "comment_email": email, "comment_url": url, "comment_content": content, "comment_post_id": post_id } | JSON | | Gallery.getPhotoAlbums() | /public/gallery_photos/get_albums | POST | { "page_number": number } | JSON | | Gallery.getPhotoPreview() | /public/gallery_photos/preview | POST | { "id": number } | JSON | | Gallery.getVideos() | /public/gallery_photos/get_videos | POST | { "page_number": number } | JSON | | Student.getStudents() | /public/student_directory/get_students | POST | { "academic_year_id": number, "class_group_id": number } | JSON | | Alumni.getAlumni() | /public/alumni_directory/get_alumni | POST | { "page_number": number } | JSON | | Employee.getEmployees() | /public/employee_directory/get_employee | POST | { "page_number": number } | JSON | | OpeningSpeech.getOpeningSpeech() | /public/opening_speech | GET | | HTML | | Download.getFiles() | /public/download/get_files | POST | { "slug": string, "page_number": number } | JSON | | Subscribe.subscribe() | /subscribe | POST | [H] { "subscriber": string, "csrf_token": string } | JSON | | Pollings.vote() | /vote | POST | [H] { "answer_id": number, "csrf_token": string } | JSON |

Data to send headers for [H] | Data to send | URL Path | Headers required | | ------------ | -------- | ---------------- | | { "subscriber": string, "csrf_token": string } | /subscribe | Cookie: _sessions=string | | { "answer_id": number, "csrf_token": string } | /vote | Cookie: _sessions=string |

Install

Install using npm:

npm i cms_sekolahku_api

Contribute

This module is not complete yet. There are still hopefully more information to acquire that haven't been implemented in this API.

Most of the information were completely private and couldn't be acquired, and making it public from the school's organization will help this module grows bigger. Alternative way: making an algorithm. (could be risky when the website is modified to not look the same as the CMS Sekolahku)

However, with your help, it would be a lot faster to complete this project!

You can do:

  • Try help adding/changing something (example: my bad code) in this project by making a new pull request! or
  • If you find any issues/suggestions regarding about this module, make a new issue!

Anything that would improve this module a bit!

Is it recommended?

Probably not for most developers. I just made this in the first place because I was bored.