Convert Figma logo to code with AI

chavyleung logoscripts

BoxJs

5,130
1,137
5,130
71

Top Related Projects

8,116

This project is based on the scripting capabilities of several excellent iOS proxy tools (e.g. Surge, Quantumult X)

分流规则、重写写规则及脚本。

Quick Overview

The chavyleung/scripts repository is a collection of JavaScript scripts primarily focused on automation and task scheduling for various platforms and services. It includes scripts for signing in to different websites, collecting rewards, and performing other automated tasks. The project is mainly targeted at Chinese users and services.

Pros

  • Wide range of supported platforms and services
  • Active community and frequent updates
  • Detailed documentation and usage instructions
  • Customizable and extensible scripts

Cons

  • Primarily focused on Chinese platforms, limiting global usability
  • Some scripts may violate terms of service of certain platforms
  • Requires technical knowledge to set up and use effectively
  • Potential security risks if not used carefully

Code Examples

Here are a few examples of how to use some of the scripts in this repository:

  1. Signing in to Bilibili:
const $ = new Env('Bilibili')
const cookie = $.getdata('bilibili_cookie')

;(async () => {
  await signIn()
  $.done()
})()

function signIn() {
  return new Promise((resolve) => {
    const url = 'https://api.live.bilibili.com/sign/doSign'
    const headers = { Cookie: cookie }
    $.get({ url, headers }, (error, response, data) => {
      if (error) {
        $.log(error)
        resolve()
      } else {
        $.log(data)
        resolve()
      }
    })
  })
}
  1. Checking in on JD:
const $ = new Env('JD')
const cookie = $.getdata('jd_cookie')

;(async () => {
  await checkIn()
  $.done()
})()

function checkIn() {
  return new Promise((resolve) => {
    const url = 'https://api.m.jd.com/client.action?functionId=signBeanIndex'
    const headers = { Cookie: cookie }
    $.post({ url, headers }, (error, response, data) => {
      if (error) {
        $.log(error)
        resolve()
      } else {
        $.log(data)
        resolve()
      }
    })
  })
}

Getting Started

To use these scripts:

  1. Clone the repository:

    git clone https://github.com/chavyleung/scripts.git
    
  2. Install dependencies:

    cd scripts
    npm install
    
  3. Configure your environment variables and cookies as required by each script.

  4. Run a script using Node.js:

    node path/to/script.js
    

Note: Make sure to read the documentation for each script carefully before use, as some may require additional setup or have specific usage instructions.

Competitor Comparisons

8,116

This project is based on the scripting capabilities of several excellent iOS proxy tools (e.g. Surge, Quantumult X)

Pros of Script

  • More focused on iOS and Surge-specific scripts
  • Includes a wider variety of scripts for different apps and services
  • Generally more up-to-date with recent commits

Cons of Script

  • Less organized repository structure
  • Fewer contributors and community engagement
  • Limited documentation and usage instructions

Code Comparison

Script:

function nobyda() {
    const isRequest = typeof $request != "undefined"
    const isSurge = typeof $httpClient != "undefined"
    const isQuanX = typeof $task != "undefined"
    const notify = (title, subtitle, message) => {
        if (isQuanX) $notify(title, subtitle, message)
        if (isSurge) $notification.post(title, subtitle, message)
    }
    // ... (additional code)
}

scripts:

const $ = new Env('chavyleung')
const KEY_sessions = 'chavy_boxjs_sessions'
const KEY_globalvar = 'chavy_boxjs_globalvar'
const KEY_app_subCaches = 'chavy_boxjs_app_subCaches'
const KEY_sysCaches = 'chavy_boxjs_sysCaches'
// ... (additional code)

Both repositories provide useful scripts for automation and task management, but they differ in their focus and organization. Script is more tailored for iOS and Surge users, while scripts offers a broader range of applications. The code comparison shows different approaches to environment detection and variable initialization.

分流规则、重写写规则及脚本。

Pros of ios_rule_script

  • More comprehensive rule sets for various platforms and applications
  • Regularly updated with a larger community contribution
  • Includes additional tools and utilities for rule management

Cons of ios_rule_script

  • May be more complex to navigate due to its larger scope
  • Potentially higher resource usage due to extensive rule sets
  • Steeper learning curve for beginners

Code Comparison

scripts:

const $ = new Env('JD_DailyBonus')
const notify = $.isNode() ? require('./sendNotify') : '';
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';

ios_rule_script:

import re
from typing import List, Union
from ruamel.yaml import YAML

def load_yaml(file_path: str) -> Union[dict, list]:
    with open(file_path, 'r', encoding='utf-8') as f:
        return YAML().load(f)

Key Differences

  • scripts focuses on specific scripts for various platforms
  • ios_rule_script provides a broader range of rules and tools
  • scripts uses JavaScript, while ios_rule_script uses Python for some components
  • ios_rule_script offers more granular control over rule customization
  • scripts may be easier to use for simple task automation

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Chavy Scripts

GitHub release (latest by date) GitHub contributors

Telegram讨论组:Chavy Scripts Group



🧰BoxJs

简介

A SPA Appliction be used for scripts utils

使用方式

安装对应模块/插件后,浏览器访问: boxjs.com

安装链接


🛠️Env.js

调用方式

  • Env.min.js放置于嵌入式脚本底端,然后头部调用功能
    const $ = new Env("你的脚本名称");
    

功能列表

HttpClient

  • 支持方法: get, post, put, delete, head, options, patch
    let option = {
        url: "http://www.example.com/", // URL,必须
        headers: { // 请求头,可选
            "Accept": "*/*",
            "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 15_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Mobile/15E148 Safari/605.1.15",
            "Content-Type": "application/json; charset=utf-8"
            ""
        },
        body: `auth_key=1234567&source_lang=EN&target_lang=ZH` // 请求体,POST等方法必须,字符串或对象
    }
    let result = $.get(URL<String> or options<Object>, callback(error, response, data)) // 不支持异步
    let result = $.post(URL<String> or options<Object>, callback(error, response, data)) // 不支持异步
    ……
    
    let result = await $.http.get(URL<String> or options<Object>).then(callback(response))
    let result = await $.http.post(URL<String> or options<Object>).then(response => response.body)
    let result = await $.http.put(URL<String> or options<Object>).then(response => {
        $.log(JSON.stringify(response.headers));
        return response.body
    })
    ……
    

持久化数据

```javascript

$.getdata(‘chavy’) // 读取持久化数据 (string格式)
$.setdata(string, ‘chavy’) // 写入持久化数据 (string格式)
$.getjson(‘chavy’, default_value<String, Object>) // 读取持久化数据 (object格式),当读取失败后返回默认值
$.setjson(object, ‘chavy’) // 写入持久化数据 (object格式)

```

安装链接

正式版


赞助

  1. CloudFlare

📃LICENSE

Copyright © 2019-present chavyleung. This project is GPL licensed.