Total Pageviews

Friday, 25 September 2026

php-get-image-from-clipboard

 Get image from clipboard and save it to an image file(jpg/png) by using php.

PHP-GetImgFromClipboard is a tool that allows you to get image on the clipboard(usually copy to the clipboard by taking a screenshot or copy from web page) and save it to an image file like jpg or png.

Install

composer require xiebruce/php-get-image-from-clipboard

Requires

Actually, php can not get image on the clipboard directly, so this tool is rely on other tools.

For macOS

For macOS, it relies on pngpaste, so you should install pngpaste first:

brew install pngpaste

For Windows 10

For Windows 10, it's free to use, nothing need to be install.

For Windows 7

For Windows 7, you need to update Powershell. Download Powershell update package "Win7AndW2K8R2-KB3191566-x64.zip" from here: https://www.microsoft.com/en-us/download/details.aspx?id=54616, then update and restart.

Before update, you can check the Powershell version. Click "Start" menu on the bottom right corner, input "powershell" to search, then powershell shows up like this: Xnip2019-09-05_14-43-33

Click to open it and type this command:

$PSVersionTable

Now you can see, before update, the Powershell version is 2.0: Check Powershell version before update

After update, the Powershell version is 5.0: Check Powershell version after update

For Linux Desktop

For Linux Desktop System(e.g. Ubuntu, Manjaro, CentOS etc.) , you need to install xclip.

On Ubuntu:

apt install xclip

I didn't test other Linux distributions, but it should be work as long as you install xclip.

 from https://github.com/xiebruce/php-get-image-from-clipboard

toplist, 今日热榜

今日热榜是一个获取各大热门网站热门头条的聚合网站,使用Go语言编写,多协程异步快速抓取信息。

安装教程

  1. 编译

    cd {root_path} # 项目根目录
    go build -o ./App/GetHot App/GetHot.go
    go build -o ./App/Server App/Server.go 
    
  2. 创建数据库,如 news,执行database.sql创建表,更改配置文件Config/mysql.toml

  3. 编辑文件 Html/js/blog/globalConfig.js

    const ServerIp = 'http://{your_domain}:9090' // 替换成服务器域名
    
  4. 部署定时任务/App/GetHot.go爬虫程序,且以守护进程的方式执行Server.go

    crontab -e # 添加一行 0 */1 * * * {root_path}/App/GetHot
    nohup {root_path}/App/Server &
    
  5. 测试

    • 打开http://{yourdomain}:9090/ 即可访问今日热榜

目录说明

TopList/
├── App
│   ├── GetHot.go   爬虫程序需要Cron定时任务执行
│   └── Server.go   Server程序需要守护进程的方式执行
├── Common
│   ├── Db.go       DB组件
│   └── Message.go  
├── Config
│   ├── MySql.go    mysql配置读取组件
│   └── mysql.toml  mysql配置文件需要手动配置
├── Cron
│   ├── GetHot.sh   爬虫Cron程序可以是每小时执行一次
│   └── README.md
├── database.sql    数据库建表文件
├── Html
│   ├── css
│   ├── hot.html    前端热榜展示网页
│   └── js
│  
└── README.md

API说明

获取所有类型

  • Method: GET
  • URL: https://www.tophub.fun:8888/GetAllType
  • Param:无
  • Body:
{
    "Code":0,
    "Message":"获取数据成功",
    "Data":[
        {"id":"1","sort":"63908","title":"知乎"},
        {"id":"2","sort":"21912","title":"虎扑"},
        {"id":"6","sort":"11707","title":"天涯"},
        {"id":"7","sort":"12546","title":"知乎日报"},
       ]}

获取具体类型热榜数据

  • Method: GET
  • URL: https://www.tophub.fun:8888/v2/GetAllInfoGzip?id=59&page=0
  • Param:id
  • Body:
{
    "Code":0,
    "Message":"获取数据成功",
    "Data":{
        "data":[
            {
                "id":1327371,
                "CreateTime":1579487422,
                "commentNum":0,
                "approvalNum":0,
                "Title":"180W 买了个小破房,月供 7500 多,压力山大",
                "hotDesc":"200条评论",
                "Url":"https://www.v2ex.com/t/639366#reply200",
                "imgUrl":"",
                "isRss":"",
                "is_agree":0,
                "TypeName":"社区"
            },
            {
                "id":1326304,
                "CreateTime":1579483806,
                "commentNum":0,
                "approvalNum":0,
                "Title":"口罩(N95) 目前应该买哪个? 有研究过得推荐一下?",
                "hotDesc":"106条评论",
                "Url":"https://www.v2ex.com/t/639343#reply106",
                "imgUrl":"",
                "isRss":"",
                "is_agree":0,
                "TypeName":"社区"
            },
        ],
        "page":10
    }
}
from https://github.com/tophubs/TopList

datetime.app

 https://datetime.app 显示你的本地时间

ip.network

 https://www.ip.network

在cmd.exe里或git bash程序里运行:curl -4 ip.network

即可显示你本机的ip v4地址。



Thursday, 24 September 2026

qrcode.fun , 免费二维码生成器

 https://qrcode.fun/

https://qrcode.fun/zh-hans

hexo-online-server, Hexo在线编辑发布文章的插件


本插件已实现以下功能:

  • 在线新建,编辑,删除post和page(默认路径)
  • hexo clean,hexo server,hexo deploy
  • 源码同步

需求

  • Node.js >= 10.0
  • Hexo 4.X(只测试了4.X)
  • Git
  • mac系统close server功能无法使用(我没有mac设备,无法测试)

准备工作

  • 将源码托管到Git仓库(建议使用私人仓库)
  • 配置好git, 确认可以使用以下命令进行同步:
    • git pull
    • git add --all .
    • git commit -m "..."
    • git push

使用

安装

npm install hexo-online-server -S

配置

  1. 新建config.json文件, 内容如下:

    {
        "indexPath": "/", // 自定义主页路径, 以"/"结尾
        "port": 4001, // http监听端口
        "wsPort": 4002, // websocke监听端口
        "secret": "", // 用来签名session ID cookie,https://www.npmjs.com/package/express-session#secret
        "user": "", // 登录用户名
        "passwordHash": "", // 密码加密后的字符串
        "autoSave": 300000, // 编辑文章时自动保存时间, 单位:ms, 0为不自动保存
        "noticeUrl": "", // 当有用户登录时向`此链接+message`发送get请求,留空则不通知
        "pull": ["git pull"], // 同步到git命令
        "push": ["git add --all .","git commit -m 'update'","git push"], // 从到git同步命令
        "ssl": false, // 是否启用SSL
        "private": { // 启用ssl需配置此项
            "key": "", // SSL证书key路径
            "crt": "" // SSL证书路径
        }
    }

    上面的注释要删掉!

  2. 把config.json文件保存到你的博客目录以外的地方, 在_config.yml中添加:

    onlineConfigPath: '../config.json' #`config.json`文件路径
  3. 使用以下命令获取加密密码, 将得到的passwordHash添加到config.json文件:

    hexo bcrypt 你的密码
  4. 运行hexo online, 浏览器打开http://localhost:4001/

     https://blog.hclonely.com/posts/ebe9edfc/#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98

    from  https://github.com/melodyjerry/hexo-online-server

     

放鬆的高質感Jazz