質問編集履歴

1

2019/06/06 10:15

投稿

pentell
pentell

スコア40

test CHANGED
File without changes
test CHANGED
@@ -30,44 +30,56 @@
30
30
 
31
31
 
32
32
 
33
+ ```ここに言語を入力
34
+
33
35
  import tweepy
34
36
 
35
37
 
36
38
 
37
39
  def api():
38
40
 
39
- consumer_key = '××××'
40
41
 
41
- consumer_secret = '××××'
42
42
 
43
- access_key = '××××'
44
43
 
45
- access_secret = '××××'
46
44
 
47
-
45
+ consumer_key = '××××'
48
46
 
49
- auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
47
+ consumer_secret = '××××'
50
48
 
51
- auth.set_access_token(access_key, access_secret)
49
+ access_key = '××××'
52
50
 
53
- api = tweepy.API(auth)
51
+ access_secret = '××××'
54
52
 
55
- return api
56
53
 
54
+
57
-
55
+ auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
56
+
57
+ auth.set_access_token(access_key, access_secret)
58
+
59
+ api = tweepy.API(auth)
60
+
61
+
62
+
63
+ return api
64
+
65
+
66
+
67
+ dic={}
58
68
 
59
69
  for tweet in api().search('通貨'):
60
70
 
61
- text = tweet.text
71
+ text = tweet.text
62
72
 
63
- id = tweet.id
73
+ id = tweet.id
64
74
 
65
- dic.update({id:text})
75
+ dic.update({id:text})
66
76
 
67
- if '@' in dic[id]:
77
+ if '@' in dic[id]:
68
78
 
69
- pass
79
+ pass
70
80
 
71
- else:
81
+ else:
72
82
 
73
- api().create_favorite(id)
83
+ api().create_favorite(id)
84
+
85
+ ```