print-my-profile-pic README

项目的 README,来自 github.com/aschmelyun/print-my-profile-pic。合并为一个 markdown 文件:README.md。

print-my-profile-pic

Star this repo to have your GitHub profile picture framed, printed out on my receipt printer, and stuck to my wall.

That's it!

[!TIP] If you give a one-time sponsorship of any amount beforehand, your profile picture will be printed in a special frame.

Holding up a photo of me printed on a receipt Pinning a receipt to a board called the Hall of Frame

How's it work?

GitHub allows you to create webhooks for specific events on your repos, I've set one up for starring this project.

When that happens, a payload is POSTed to a Cloudflare tunnel domain, which leads to a PHP script running on a Raspberry Pi that's sitting on my desk.

From the inbound request, you can gleen info about the person who starred the repo, like their display name and avatar URL. The script takes their profile picture, renders it behind a cut-out of a photo frame, and then adds some other info I thought should be included in each receipt.

The RPi is connected to an Epson TM-T88IV thermal receipt printer via USB, and the PHP script uses my go-to escpos-php library to format the receipt data and send it off to the printer.

But why?

It sounded fun when my friend Sam mentioned it. That's pretty much it!

What now?

I'll periodically update this README with a picture of the pinboard I've dubbed the "Hall of Frame" as pictures get added to it.

Want to add a new frame? Send in a PR!

print-my-profile-pic (aschmelyun/print-my-profile-pic)

正在搜索数据库…

这是什么?给这个 GitHub 仓库点 Star 会触发一个 Webhook,通知作者桌上的一台树莓派把你的 GitHub 头像打印在热敏小票打印机上,然后贴到他的墙上。
这是需要我安装的东西,还是单纯的 GitHub 小玩意?这不是需要你自己运行的软件,而是一个个人的艺术/Webhook 项目。无需安装任何东西;这个仓库的存在纯粹是为了让 GitHub 把 Star 事件发送到作者自己的硬件上。
我要怎么让它运行起来?点击这个仓库 GitHub 页面上的 Star 按钮就是全部操作。之后的所有环节(Webhook、树莓派、打印机)都属于作者自己的设置。
除了 GitHub 账号,我还需要别的东西吗?不需要,只要有一个 GitHub 账号来给仓库点 Star 即可;Cloudflare 隧道、PHP 脚本、树莓派和打印机都由作者运行。
我的头像会马上被打印出来吗?没有实时确认。作者说,等有新的打印件加入后,他会定期发布墙板的照片,所以不会即时反馈。
到底谁能从给这个仓库点 Star 中受益?主要是给作者墙面增添一点乐趣——点 Star 的人会让自己的头像被实体打印并裱框,除此之外没有其他实际用途。
Webhook 究竟是怎样传到打印机的?GitHub 把 Star 的 Webhook 发送到一个 Cloudflare 隧道域名,该域名再转发给树莓派上的一个 PHP 脚本;脚本会把头像渲染进一个相框里,然后使用 escpos-php 库在 Epson TM-T88IV 上打印出来。
有没有办法获得特别的打印效果?有——在点 Star 之前一次性赞助任意金额,你的头像就会被打印在一个特别的相框里。
作者为什么要做这个?这个点子最初是他朋友 Sam 开的一个玩笑,除此之外没有更深的动机。
大小
7.8 MB
星标
1.9K
更新
提交Oct 29
时长
22天
提交 · 90 天