查看最近编辑的 etherpad
Prescript:令人惊叹的 etherpad 最近开源了。在此获取:http://code.google.com/p/etherpad。这是我在 StackOverflow 上了解到的关于 etherpad 代码的第一个问题。如果您是 etherpad 开源社区的一员,您可能需要订阅标记为“etherpad”的问题的 RSS 提要< /a> 以防万一这种情况流行起来!
我的实际问题,假设您在自己的服务器上安装了 etherpad:
首先,这是一个查看最近编辑的 pad 的查询:
SELECT id,lastWriteTime,creationTime,headRev
FROM PAD_SQLMETA ORDER BY lastWriteTime, headRev;
或者,如果您想从unix 提示:
mysql -u root -pPASSWD etherpad -e "select id,lastWriteTime,creationTime,headRev
from PAD_SQLMETA order by lastWriteTime, headRev"
这很方便,但是每次有人在浏览器中查看 pad 时,lastWriteTime
实际上都会更新。我宁愿按上次实际编辑的时间对垫进行排序。可能有一个奇特的 SQL 查询涉及与另一个表的联接,该表将显示实际的上次编辑时间。有谁知道那是什么?或者,您可以有一个脚本来通知 headRev 何时发生变化,但这似乎不是最干净的方法。
Prescript: The amazing etherpad was recently open sourced. Get it here: http://code.google.com/p/etherpad. This is the first question that I know of on StackOverflow about the etherpad code. If you're part of the etherpad open source community, you might want to subscribe to the RSS feed for questions tagged 'etherpad' just in case this catches on!
My actual question, which assumes you have etherpad installed on your own server:
First, here's a query to view recently edited pads:
SELECT id,lastWriteTime,creationTime,headRev
FROM PAD_SQLMETA ORDER BY lastWriteTime, headRev;
Or, if you want to run it from a unix prompt:
mysql -u root -pPASSWD etherpad -e "select id,lastWriteTime,creationTime,headRev
from PAD_SQLMETA order by lastWriteTime, headRev"
That's handy, however lastWriteTime
actually gets updated every time someone so much as views a pad in their browser. I'd rather sort the pads by when they were actually last edited. There's probably a fancy SQL query involving a join with another table that would show actual last edit time. Does anyone know what that is? Alternatively, you could have a script that notices when headRev changes but that doesn't seem like the cleanest way to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还没有完全弄清楚原来问题的答案,但我编写了一个实现类似功能的脚本。
它的主要目的是导出我所有平板的纯文本版本并将它们存储在我的笔记本电脑上。
作为副作用,它会向我显示哪些焊盘已更改,并让我看到自上次导出版本以来的差异。
它还显示哪些是新创建的。
首先,在托管 etherpad 实例的服务器上创建以下脚本
padlist.pl
:然后在本地计算机上运行以下脚本
fetchall.pl
。它会吸收所有垫子的快照,并告诉您哪些垫子已更改以及哪些垫子是新出现的。
要查看自上次获取 pad foo 以来的差异:
I haven't quite figured out the answer to my original question but I wrote a script that achieves something similar.
It's main purpose is to export plain text versions of all my pads and store them on my laptop.
As a side effect it shows me which pads have changed and lets me see a diff since the last exported version.
It also shows which ones were newly created.
First, create the following script,
padlist.pl
, on the server that hosts your etherpad instance:Then run the following script,
fetchall.pl
, on your local machine.It will suck down snapshots of all your pads and tell you which ones have changed and which have newly appeared.
To see a diff of pad foo since the last time I fetched it: