0
コードは、ツイートの内容のみを抽出します。python twitter crawling_how私はつぶやきの日付やツイートの時間を抽出できますか?
例:13703:{ 'テキスト': '11111 @ RT:こんにちはこんにちはこんにちはこんにちはこんにちは~~'}
私は、日付(2017年4月16日)、または時間(21:40)のを抽出したいですそれは可能でしょうか?
import tweepy
import time
import os
import json
import simplejson
search_term = 'word1'
search_term2= 'word2'
search_term3='word3'
lat = "xxxx"
lon = "xxxx"
radius = "xxxx"
location = "%s,%s,%s" % (lat, lon, radius)
API_key = "xxxx"
API_secret = "xxxx"
Access_token = "xxxx"
Access_token_secret = "xxxx"
auth = tweepy.OAuthHandler(API_key, API_secret)
auth.set_access_token(Access_token, Access_token_secret)
api = tweepy.API(auth)
c=tweepy.Cursor(api.search,
q="{}+OR+{}".format(search_term, search_term2, search_term3),
rpp=1000,
geocode=location,
include_entities=True)
data = {}
i = 1
for tweet in c.items():
data['text'] = tweet.text
print(i, ":", data)
i += 1
time.sleep(1)