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

aparat.js

v1.0.1-latest

Published

The aparat website services for npm package.

Downloads

15

Readme

aparat.js

The aparat website services in one package free to use and more quality.

Doc

An example to how catch user information like followers count and etc:

const { API } = require("aparat.js");

const api = new API();

(async () => {

    // User information results.
    const user = await api.user.search("shervinbdndev");
    console.log(`Followers: ${user.followers.toLocaleString()}`); // Returns: 4
    console.log(`Followings: ${user.followings.toLocaleString()}`); // Returns: 2

})();

User object results:

{
    "description": "درود،\nتو این کانال درباره مباحث برنامه نویسی صحبت میکنم و سعی دارم تا تجربه ام از کار با تکنولوژی ها رو آموزش بدم.",
    "created_at": "2020-01-15",
    "followers": "4 ",
    "followers_int": 4,
    "followings": "2",
    "followings_int": 2,
    "priority": "null",
    "total_video": 20,
    "total_views": "224 ",
    "is_forkids": false,
    "is_banned": false,
    "is_official": false,
    "user": {
        "name": "شروین بدن آرا",
        "username": "shervinbdndev",
        "id": 7093301,
        "hash_id": "8d5f2763430188a563fa6214ed2c45777f7198a6",
        "icon": "https://static.cdn.asset.aparat.com/profile-photo/7093301-467581-b.jpg",
        "cover": null,
        "links": {
            "website": "https://shervinbdndev.vercel.app/#/",
            "twitter": null,
            "lenzor": null,
            "cloob": null,
            "facebook": null
        }
    },
    "live": {
        "is_live": false,
        "url": "https://www.aparat.com/shervinbdndev/live",
        "title": null,
        "description": null,
        "cover": null,
        "donate_link": null,
        "last_start_date": null,
        "last_end_date": null,
        "moderators": [
            []
        ],
        "vip_users": null,
        "tag": {
            "id": null,
            "name": null,
            "type": null,
            "picture": null,
            "is_game": null
        },
        "category": {
            "id": null,
            "name": null
        },
        "chat": {
            "pined_message": null
        }
    }
}

How search a video or get the information from it:

const { API } = require("aparat.js");

const api = new API();

(async () => {

    // Searched vidoe results.
    const videos = await api.video.search("SpongBob");
    const video = videos[0];
    console.log(video.url); // Returns: https://www.aparat.com/v/eHEjW

})();

Results of single video information:

{
    "id": 54992465,
    "title": "بازی ترسناک باب اسفنجی در راک باتم سم کوتاه ! Spongbob Day of Terror",
    "description": "برای دلگرمی بیشتر لطفا هم زنگوله ویدیورو فعال کنید هم شبکه های اجتماعی دنبال کنید عشقید\n\nساعت استریم : هرشب ساعت 9 تا 12 در سایت آپارات\nویدیو جدید کانال هر روز ساعت 9 صبح اپلود میشه\n\nروبینو https://www.rubika.ir/ripbroadcast \nروبیکا https://www.rubika.ir/ripbroadcast11\nیوتیوب www.youtube.com/ripbroadcast\nدیسکوردwww.discord.gg/c4kXV5RHsw\nتوییچ www.twitch.tv/ripbroadcast\nتلگرام t.me/ripbroadcast\nاینستاگرام www.instagram.com/ripbroadcast\nحمایت مالی www.sibmo.ir/ripbroadcast\n\nتگ :\nعمو امیر\nRipbroadcast\nگیم پلی\n",
    "url": "https://www.aparat.com/v/eHEjW",
    "uploader": {
        "name": "Rest In Peace",
        "username": "rest_in_peace",
        "id": 3921056,
        "icon": "https://static.cdn.asset.aparat.com/profile-photo/3921056-851567-m.jpg",
        "is_official": true
    },
    "tags": [
        ""
    ],
    "views": "28 هزار",
    "views_int": 28039,
    "likes": "2782",
    "duration": 428,
    "poster": "https://static.cdn.asset.aparat.com/avt/54992465-7970-l__4352.jpg?width=900&quality=90&secret=pNq7PpNOky1WgplrE93-Kw",
    "preview": "https://static.cdn.asset.aparat.com/avt/54992465_15s.mp4",
    "frame": "https://www.aparat.com/video/video/embed/videohash/eHEjW/vt/frame",
    "publish_at": "2023-09-30 09:04:52"
}

Results of video search method is an array like the exmple:

[
    {
        "id": 54992465,
        "title": "بازی ترسناک باب اسفنجی در راک باتم سم کوتاه ! Spongbob Day of Terror",
        "description": "برای دلگرمی بیشتر لطفا هم زنگوله ویدیورو فعال کنید هم شبکه های اجتماعی دنبال کنید عشقید\n\nساعت استریم : هرشب ساعت 9 تا 12 در سایت آپارات\nویدیو جدید کانال هر روز ساعت 9 صبح اپلود میشه\n\nروبینو https://www.rubika.ir/ripbroadcast \nروبیکا https://www.rubika.ir/ripbroadcast11\nیوتیوب www.youtube.com/ripbroadcast\nدیسکوردwww.discord.gg/c4kXV5RHsw\nتوییچ www.twitch.tv/ripbroadcast\nتلگرام t.me/ripbroadcast\nاینستاگرام www.instagram.com/ripbroadcast\nحمایت مالی www.sibmo.ir/ripbroadcast\n\nتگ :\nعمو امیر\nRipbroadcast\nگیم پلی\n",
        "url": "https://www.aparat.com/v/eHEjW",
        ...
    },
    {
        "id": 55890911,
        "title": "قسمت هفتم بازی Spongbob Battle for Bikini Bottom | مراحل خواب باب اسفنجی!",
        "description": "من رو میتونید از لینک های زیر دنبال کنید!\nhttps://rubika.ir/MRGAMETESTER\nاینستا: www.instagram.com/mr.gametesterap\nحمایت:https://reymit.ir/mr.game_tester",
        "url": "https://www.aparat.com/v/pM9mh",
        ...
    }, 
    ...
]

In version 1.0.1 you can check the user profile is it start a stream or not and will be alert to you. In an event you can have this option and use it like the example:

const { API } = require("aparat.js");

const api = new API();

api.checkStream("shervinbdndev");
api.on("streamStart", async (user) => {
    console.log("User is on the stream:", user.live.url); // Returns: https://www.aparat.com/shervinbdndev/live
});

User object is equals with user.search object.