简体   繁体   English

在服务器端渲染推文

[英]Rendering tweets on the server side

Is there a library that would take the API response and render tweets server-side in accordance with twitter ddr ? 是否有一个库可以接受API响应并根据twitter ddr在服务器端呈现tweet?

I'm concerned that I'm reinventing the wheel when processing tweet entities , parsing the timestamp and rendering author name/avatar/@username. 我担心在处理tweet实体 ,解析时间戳并呈现作者姓名/头像/ @用户名时,我正在重新发明轮子。 Twitter's widget.js seems to be very client side focused as-is; Twitter的widget.js似乎非常注重客户端。 I haven't found the script's version that's documented and licensed for modified use on the server. 我尚未在服务器上找到已记录和许可用于修改用途的脚本版本。

I'd rather avoid rendering on the client when it could be be pre-rendered and cached - just showing the latest tweet from a given account. 我宁愿避免在客户端可以进行预渲染和缓存时进行渲染-只是显示给定帐户的最新推文。

您应该看一下twitter-text ,它可以在服务器端使用(作为node.js包),您可能可以使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM