- Sep 04 Thu 2014 13:12
(尚未設定標題)
- Sep 03 Wed 2014 00:23
0902 94PUT
- Sep 02 Tue 2014 19:49
又到了閉著眼買的時候...
9357一到..閉眼全押...
- Aug 29 Fri 2014 23:54
(尚未設定標題)
習慣聽你分享生活細節
害怕破壞完美的平衡點
保持著距離一顆心的遙遠
我的寂寞你就聽不見
我走回從前你往未來飛
遇見對的人錯過交叉點
明明你就已經站在我面前
我卻不斷揮手說再見
以後別做朋友 朋友不能牽手
想愛你的衝動 我只能笑著帶過
最好的朋友 有些夢 不能說出口
就不用承擔 會失去你的心痛
劃一個安全的天空界線
誰都不准為我們掉眼淚
更多更詳盡歌詞 在
放棄好好愛一個人的機會
要看著你幸福到永遠
以後別做朋友 朋友不能牽手
想愛你的衝動 我只能笑著帶過
最好的朋友 有些夢 不能說出口
就不用承擔 會失去你的心痛
忍住失控 太折磨 我自作自受
回憶都是我 好不了的傷口
以後還是朋友 還是你最懂我
我們有始有終 就走到世界盡頭
永遠的朋友 祝福我 遇見愛以後
不會再懦弱 緊緊握住那雙手
- Aug 29 Fri 2014 12:50
(尚未設定標題)
https://www.youtube.com/watch?v=1qcFzZrhkWY
- Aug 29 Fri 2014 12:43
小買看看...
96WC
- Aug 28 Thu 2014 23:19
json example -realtime
Now I am ready to feed data into my queue. For this I used Daniel Forsyth's example that grabs a topic from the twitter stream and stores it into mongodb.I replaced the mongo code with activemq code. I used Pika for the python AMQP client. Here is my modified feed consumer:
import tweepy
import sys
import pika
import json
import time
#get your own twitter credentials at dev.twitter.com
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
class CustomStreamListener(tweepy.StreamListener):
def __init__(self, api):
self.api = api
super(tweepy.StreamListener, self).__init__()
#setup rabbitMQ Connection
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost')
)
self.channel = connection.channel()
#set max queue size
args = {"x-max-length": 2000}
self.channel.queue_declare(queue='twitter_topic_feed', arguments=args)
def on_status(self, status):
print status.text, "\n"
data = {}
data['text'] = status.text
data['created_at'] = time.mktime(status.created_at.timetuple())
data['geo'] = status.geo
data['source'] = status.source
#queue the tweet
self.channel.basic_publish(exchange='',
routing_key='twitter_topic_feed',
body=json.dumps(data))
def on_error(self, status_code):
print >> sys.stderr, 'Encountered error with status code:', status_code
return True # Don't kill the stream
def on_timeout(self):
print >> sys.stderr, 'Timeout...'
return True # Don't kill the stream
sapi = tweepy.streaming.Stream(auth, CustomStreamListener(api))
# my keyword today is chelsea as the team just had a big win
sapi.filter(track=['chelsea'])