fbcomments.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Facebook-Scripts 作者: Sunil02324 项目源码 文件源码
def sendDocumentToSolr(comment):
    dateTimeFormat = '%Y-%m-%dT%H:%M:%SZ'
    created_time = datetime.fromtimestamp(long(comment['time'])).strftime(dateTimeFormat)

    try:
        print "send it to solr"

        s.add(
            in_reply_to_object_id=objectId,
            user_id=comment['fromid'],
            name=comment['username'],
            like_count=comment['likes'],
            id=comment['id'],
            created_at=created_time,
            text_length_i=len(comment['text']),
            text=comment['text']);

    except solr.core.SolrException as solrerror:
        print "OUCH !! Something bad happened Larry!" 
        print solrerror
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号