dounou9751 2011-01-10 13:41
浏览 64
已采纳

如何对twitter流式api结果进行分类

Hey, im looking to build a product that 'listens' to twitter streaming api and tracks certain keywords. everything can be done. what im missing is one thing. This product is intended to be operational and serving multiple clients. twitter encourages developers to open as little as possible connections to the api so i need to track multiple keywords at once for multiple clients.

My question is, how can i differentiate between those tweet results so i can organize the output for each clients? meaning if client A tracks 'hiscompany' how can i categorize the tweet results from the streaming api under client A project.

I want to categorize upon insert to the database, should i just preg_match on each result to determine the keyword associated in it? whats the best practices for it?

  • 写回答

1条回答 默认 最新

  • dtio35880438 2011-01-11 16:59
    关注

    Here's how I would approach this:

    • Use the Streaming API's track to get results for all the keywords (for all clients).
    • Determine what keywords are in each status using strpos() (or similar, don't see the need for a regular expression).
    • Add the status to the database, associated with all matching keywords.
    • Associate the client account with the specific keywords they want to track.

    This allows multiple clients to track the same keywords. It also allows a status to have multiple keywords. Both seem to be likely situations.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制