🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/17 16:02:23
🔄 下次更新时间:2026/01/17 17:02:23
手动刷新缓存

Greasy Fork API

Get information from Greasy Fork and do actions in it.

Този скрипт не може да бъде инсталиран директно. Това е библиотека за други скриптове и може да бъде използвана с мета-директива // @require https://update.greasyfork.org/scripts/445697/1244619/Greasy%20Fork%20API.js

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey .

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Автор
NotYou
Версия
2.0.1
Създаден
29.05.2022
Обновен
02.09.2023
Размер
9 КБ
Лиценз
LGPL-3.0

Greasy Fork API

Version: 2.0.1 License: LGPL-3.0

Description:

Parse information on greasyfork.org

Dependencies

  • GM.xmlHttpRequest
  • GM.openInTab

Docs

Static Values

languages

A list of languages

GreasyFork.languages // ['ar', 'bg', 'cs', 'da', …]

version

Current Greasy Fork API version.

GreasyFork.version // e.g. '1.2.3'

Static Methods

parseScriptNode

Argument Required Type Description
node Yes HTMLElement A script node (element) that includes data attributes

Returns information about script based on it's element.

Note: If script node doesn't have rating info (such as libraries), then properties ratingsBad, raingsOk, ratingsGood will not be included.

GreasyFork.parseScriptNode(document.querySelector('[data-script-id="437291"]')) /* Example response:
{
    cssAvailableAsJs: false
    node: <li data-script-id="437291" …>
    ratingsBad: 0
    ratingsGood: 12
    ratingsOk: 1
    scriptAuthors: { 824432: "NotYou" }
    scriptCreatedDate: "2021-12-19"
    scriptDailyInstalls: 7
    scriptId: "437291"
    scriptLanguage: "js"
    scriptName: "Open-Source Alternative Redirector"
    scriptRatingScore: 71.7
    scriptTotalInstalls: 6738
    scriptType: "public"
    scriptUpdatedDate: "2023-01-09"
    scriptVersion: "11.2.0"
    sensitive: false
}
*/

parseScriptMetadata

Returns user-script's metadata.

Argument Required Type Description
code Yes string A user-script code that includes metadata // ==UserScript== ... // ==/UserScript==
GreasyFork.getScriptCode('437291').then(code => {
    const metadata = GreasyFork.parseScriptMetadata(code) // <-- This method

    console.log(metadata) // { author: "NotYou", name: "Open-Source Alternative Redirector", …}
})

getScriptData

Returns user-script's info.

Argument Required Type Description
id Yes string A string that only contains numeric characters.
GreasyFork.getScriptData('437291').then(data => {
    console.log(data)
    /*
    Example response:
    {
        bad_ratings: 0
        code_updated_at: "2023-01-09T11:03:42.000Z"
        code_url: "https://greasyfork.org/scripts/437291-open-source-alternativ…director/code/Open-Source%20Alternative%20Redirector.user.js"
        contribution_amount: null
        contribution_url: null
        created_at: "2021-12-19T16:18:00.000Z"
        daily_installs: 7
        deleted: false
        description: "Redirects you from proprietary web-services to ethical     alternatives(front-end)."
        fan_score: "71.7"
        good_ratings: 12
        id: 437291
        license: "GNU General Public License v3.0 or later"
        locale: "en"
        name: "Open-Source Alternative Redirector"
        namespace: "-"
        ok_ratings: 1
        support_url: null
        total_installs: 6738
        url: "https://greasyfork.org/scripts/437291-open-source-            alternative-redirector"
        users: Array [ {…} ]
        version: "11.2.0"
    }
    */
})

getScriptCode

Returns user-script's code.

Argument Required Type Description
id Yes string A string that only contains numeric characters.
isLibrary No boolean Set to true if script is library (Default: false).
GreasyFork.getScriptCode('437291').then(code => {
    console.log(code)
    /* Example response:
    // ==UserScript==
    // @name Open-Source Alternative Redirector
    …
    */
})

getScriptHistory

Returns user-script's history.

Argument Required Type Description
id Yes string A string that only contains numeric characters.
GreasyFork.getScriptHistory('437291').then(data => {
    console.log(data)
    /* Example response:
    [
        { version: '11.2.0', … }
        { version: '11.1.1', … }
        { version: '11.1.0', … }
        …
    ]
    */
})

getScriptStats

Returns user-script's stats history.

Argument Required Type Description
id Yes string A string that only contains numeric characters.
GreasyFork.getScriptStats('437291').then(data => {
    console.log(data)
    /* Example response:
    {
        '2021-12-19': { installs: 2, update_checks: 0 }
        '2021-12-20': { installs: 11, update_checks: 1 }
        '2021-12-21': { installs: 6, update_checks: 4 }
        …
    }
    */
})

getScriptSet

Returns set of scripts.

Argument Required Type Description
id Yes string A string that only contains numeric characters.
page No number Page of script set. (Default: 1)
GreasyFork.getScriptSet('1').then(data => {
    console.log(data)
    /* Example response:
    [
        { id: 436446, … }
        { id: 468633, … }
        { id: 438657, … }
        …
    ]
    */
})

getUserData

Returns user's data.

Argument Required Type Description
id Yes string A string that only contains numeric characters.
GreasyFork.getUserData('824432').then(data => {
    console.log(data)
    /* Example response:
    {
        id: 824432
        name: "NotYou"
        scripts: [ {…}, {…}, {…}, … ]
        url: "https://greasyfork.org/users/824432-notyou"
    }
    */
})

searchScripts

Returns result of search request to find user-scripts by query.

Note: enter blank string to just list popular scripts.

Argument Required Type Description
query Yes string A search query.
page No number Page of scripts search. (Default: 1)
GreasyFork.searchScripts('dark theme', 2).then(data => {
    console.log(data)
    /* Example response:
    [
        { id: 25563, … }
        { id: 371158, … }
        { id: 435764, … }
        …
    ]
    */
})

searchUsers

Returns result of search request to find users by query.

Note: enter blank string to just list new users.

Argument Required Type Description
query Yes string A search query.
page No number Page of users search. (Default: 1)
GreasyFork.searchUsers('notyou').then(data => {
    console.log(data)
    /* Example response:
    [
        { id: 824432, … }
        { id: 1087451, … }
        { id: 1079658, … }
        …
    ]
    */
})

installScript

Opens installation tab of entity (user-script / user-style).

Argument Required Type Description
id Yes string A string that only contains numeric characters.
type No 'js' or 'css' Language of entity. (Default: 'js')
GreasyFork.installScript('437291') // To install user-script
GreasyFork.installScript('439627', 'css') // to install user-style

/*
Note:
GreasyFork.installScript('437291') is same as
GreasyFork.installScript('437291', 'js')
*/

Instance

An instance can only be initialized at greasyfork.org or sleazyfork.org, at other hosts constructor will throw an error. To create an instance do this:

const GF = new GreasyFork()

Instance Methods

listScripts

Returns current script list and script list's type, if scirpt list doens't exist, then throws an error.

Note: There are only 3 script list's types. 1) browse — browsed user-scripts 2) user — script list in user page 3) unknown — in cases when script list is created in unknown list.

const GF = new GreasyFork()

GF.listScripts()
/* Example response:
{
    list: [ {…}, {…}, {…}, … ]
    type: 'user'
}
*/

signOut

Sign out from Greasy Fork account.

const GF = new GreasyFork()

GF.signOut()