1.0.7 • Published 6 years ago

virgool-data v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Virgool Data

badge badge build passing Coverage Status

package for getting data of posts and user profile from virgool.io

Installation

npm install virgool-data

Usage

const virgoolData = require("virgool-data");

//get posts data
virgoolData.getPosts().then(posts => console.log(posts));

//get user data - username must be without "@"
//ex: const username = "imohamad";
virgoolData.getProfile(username).then(user => console.log(user));

posts output:

/* 
get posts data
virgoolData.getPosts().then(posts => console.log(posts));
*/

//output:
     [
        {
            "title": string, //تیتر مطلب
            "link": string, //لینک مطلب
            "reading": string, //خواندن ۲ دقیقه
            "time": string, // ۲ هفته پیش
            "category": string, // دسته بندی مطلب
            "summary": string, // خلاصه مطلب
            "cover": string, // تصویر مطلب
            "like": string, // تعداد لایک
            "comments": string, // تعداد نظرات
            "author": {
                "name": string, // نام نویسنده
                "username": string, // نام کاربری نویسنده
                "avatar": string // عکس پروفایل نویسنده
            }
        },
        {
          ...
        }
     ]

profile output:

/* 
get user data - username must be without "@"
ex: const username = "imohamad";
virgoolData.getProfile(username).then(user => console.log(user));
*/

//output:
 [
        {
            "name": string, // نام نویسنده
            "username": string, // نام کاربری نویسنده
            "avatar": string, // عکس پروفایل نویسنده
            "bio": string, // بیوگرافی نویسنده
            "followers": string, // دنبال کنندگان نویسنده
            "following": string, // دنبال شونده های نویسنده
            "postCount": number, // تعداد مطالب منتشر شده نویسنده
            "posts": [
                {
                    "title": string, // تیتر مطلب
                    "link": string, // لینک مطلب
                    "reading": string, // خواندن ۲ دقیقه
                    "time": string, // ۲ هفته پیش
                    "category": string, // دسته بندی مطلب
                    "summary": string, // خلاصه مطلب
                    "cover": string, // تصویر مطلب
                    "like": string, // تعداد لایک مطلب
                    "comments": string // تعداد کامنت های مطلب
                }
            ]
        }
]

enjoy! 🤘

Further help

visit imohamad or send e-mail: mohamad.partizan@gmail.com

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.0

6 years ago