Help us understand the problem. What is going on with this article?

wikipedia の api をつかって、記事のアクセスを見る

More than 1 year has passed since last update.

wikipedia の記事へのアクセスログ

簡単にとれるのでつくってみました。タブ区切りで結果が出力されるので、エクセルなどにはりつけてすぐにグラフ化できます。記事の題名かえて適宜ためしてみてください。

#!/usr/bin/env python
# -*- encoding:utf-8 -*-
import requests
import json
import urllib

t1='{x_type}/{x_lang}.wikipedia/all-access/all-agents/{x_article}/daily/{ymd_from}/{ymd_to}'
x_type='https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article'

# 英語 Shinzō_Abe
#x_article='Shinz%C5%8D_Abe'
#x_lang = 'en' # 英語の指定

x_article = urllib.parse.quote('前川喜平') # 
x_lang = 'ja' # 日本語の指定
ymd_from='2017050100' # 日付開始
ymd_to='2017053000'   # 日付終わり

req = requests.get(t1.format(ymd_from=ymd_from,x_lang=x_lang,x_type=x_type,x_article=x_article,
                             ymd_to=ymd_to))#req.text
for one in json.loads(req.text)['items']:
    print(one['timestamp'] + "\t" + str(one['views']) )

前川喜平

の9月のアクセスログです。グラフ化しました。

chart_20170924_1.png

zanjibar
データが好きです。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした