Coder Social home page Coder Social logo

mydingyan / minimalist-web-notepad-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xiaobin2333/minimalist-web-notepad-api

0.0 0.0 0.0 9 KB

Minimalist Web Notepad API:一款带API的开源轻量级简洁在线笔记本

Home Page: https://www.mrchung.cn/archives/47/

PHP 47.36% JavaScript 31.89% CSS 20.75%

minimalist-web-notepad-api's Introduction

Minimalist-Web-Notepad-API

Minimalist Web Notepad API:一款带API的开源轻量级简洁在线笔记本

相信大家都会试过寻找地方来进行临时记录,或者是传输一个文本给其它设备或者他人。

最近我在github发现了一个非常不错的项目Minimalist Web Notepad

十分的轻量简洁代码仅5KB,用于临时记录与传输文本非常方便,简直是极简主义者必备品!

我在原项目的基础上加入了API接口,日常使用更加方便。

安装教程

在index.php文件顶部,更改$base_url变量以指向您的站点。 确保允许Web服务器写入_notes目录。

在Apache上

您可能需要启用mod_rewrite并.htaccess在站点配置中设置文件。

在Nginx上

要启用URL重写,请将以下内容放入配置文件中: 如果记事本在根目录中:

location / {
    rewrite ^/([a-zA-Z0-9_-]+)$ /index.php?note=$1;
}

如果记事本在子目录中:

location ~* ^/notes/([a-zA-Z0-9_-]+)$ {
    try_files $uri /notes/index.php?note=$1;
}

API文档

获取指定笔记文本

接口地址:/{note}

请求方式:get

请求参数:raw

返回数据:指定笔记的内容(string)

示例参数:/demo?raw

新建指定地址笔记并写入文本 或修改指定地址笔记文本

接口地址:/{note}

请求方式:get post

请求参数:text

返回数据:saved(string)

示例参数:/demo?text=test

新建随机地址笔记并添加文本

接口地址:/?new

请求方式:get post

请求参数:text

返回数据:新建的网址url(string)

示例参数:/?new&text=test

Demo

通过网站进行文本传输

5.png

https://note.166167.xyz

通过IOS快捷指令进行剪切板同步 1.jpg 2.jpg

通过Python应用进行Win剪切板同步

import win32clipboard as w
import win32con
import requests

def copy():
    w.OpenClipboard()
    data = w.GetClipboardData(win32con.CF_UNICODETEXT)
    w.CloseClipboard()
    body = {
        "text": data,
        }
    r = requests.post('https://note.166167.xyz/demo', data = body)
    print(r.status_code,data)

def paste():
    r = requests.get('https://note.166167.xyz/demo?raw')
    data = r.text
    w.OpenClipboard()
    w.SetClipboardData(win32con.CF_UNICODETEXT,data)
    w.CloseClipboard()
    print(r.status_code,data)

def new():
    w.OpenClipboard()
    data = w.GetClipboardData(win32con.CF_UNICODETEXT)
    w.CloseClipboard()
    body = {
        "text": data,
        }
    r = requests.post('https://note.166167.xyz/?new', data = body)
    print(r.status_code,data)

minimalist-web-notepad-api's People

Contributors

xiaobin2333 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.