質問編集履歴

2

コード修正

2018/12/12 08:56

投稿

tasuke
tasuke

スコア53

test CHANGED
File without changes
test CHANGED
@@ -5,6 +5,8 @@
5
5
  また、作成したコードが以下の通りです。
6
6
 
7
7
  ```python
8
+
9
+ import os
8
10
 
9
11
  import time
10
12
 
@@ -40,21 +42,21 @@
40
42
 
41
43
  flicker = flickrapi.FlickrAPI(flickr_api_key, secret_key, format='parsed-json')
42
44
 
43
- response = flicker.photos.search(text=keyword,per_page=300,media='photos',sort='relevance',safe_search=1,extras='url_n,license')
45
+ response = flicker.photos.search(text=keyword,per_page=300,media='photos',sort='relevance',safe_search=1,extras='url_c, license')
44
46
 
45
47
  photos = response['photos']
46
48
 
47
49
  try:
48
50
 
49
- if not os.path.exists('./image-data/' + keyword):
50
-
51
- os.mkdir('./image-data/' + keyword)
52
-
53
51
  for photo in photos['photo']:
54
52
 
55
- url_q = photo['url_n']
53
+ print(photos)
56
54
 
55
+ url_q = photo['url_c']
56
+
57
+ print()
58
+
57
- filepath = './image-data/' + keyword + '/' + photo['id'] + '.jpg'
59
+ filepath = './TrainingAssistant/static/img/' + photo['id'] + '.jpg'
58
60
 
59
61
  get_photos(url_q, filepath)
60
62
 

1

タイトルの変更

2018/12/12 08:56

投稿

tasuke
tasuke

スコア53

test CHANGED
@@ -1 +1 @@
1
- githubでのプログラム利用方法について
1
+ filckerでの画像収集について
test CHANGED
File without changes