16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Qiitaのトレンド(ランキング)を取得してSlackに送信する

Last updated at Posted at 2019-11-30

・Qiitaって勉強になるけど、わざわざ自分でWebページ行くの面倒やな。。
・Qiitaの今日のランキングを1ヶ月分集計して、タイトルや記事の中身を分析したい
・単純にPythonのスクレイピングしたい

とかとか思ってQiitaのトレンド(以下のページ)をスクレイピングで取得してSlackかなんかに飛ばせ
ばいんでね。とか思い、朝にちょこまか作りました!!
Qiita.png

よくよく見たら毎朝5時と17時に更新がかかっているようなので、バッチ化してあげれば良いかも(今回はしないけど)
とりあえずサクッと作っちゃいましょうー!!

このプログラムを作るまでのわい。
『QiitaってAPIを無料で公開してるし、ランキング形式を返却してくれるAPIもあるやろ!よっしゃ早速調べてみよ!!!

............🤔???

あれ見当たらないな。。。

QiitaのAPI
≫ Qiita Developer

調べたら昔はあったらしいけど、廃止になったらしい。。。(まじか)
自分の最初の根底が覆された。(どないしよ)

QiitaのAPIが使えないと悟ったわい
『しゃーない!API使えないんだったらスクレイピングで取得したろ!!!

Qiitaさん許してや!!!そんなサーバーに負荷かけない(1日2回くらいしかアクセスしないから!!』

スクレイピングの動作環境

  • Python 3.6.5
  • Mac OS Mojave

上記の環境で動かしています。Pythonの環境構築は以下の記事でメモ書き程度ですが書いています。もし興味あれば是非。
≫ MacでPython3系の環境構築

その他ライブラリとしてrequests, json, bs4を使用しています。
pip install requestsとかでインストールできるので、別途おこなってください。

環境構築すらめんどいわ

って人には「Colaboratory」がオススメ。環境構築なしでPythonを実行できます。
≫ Colaboratory

Qiitaのトレンド(ランキング)を取得する

よっしゃ!!早速QiitaのDOM構造のチェックや!!
qiita_dom.png

ほほん。。。🤔親要素にクラスが付いてへんけど、tr-itemの部分をループで回せば全部楽勝で取得できそうやな!やってみよ!

asahaka.py
import requests;
from bs4 import BeautifulSoup;

url = "https://qiita.com/"

headers = {
	"User-Agent" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
}

res = requests.get(url, headers=headers)

# htmlをBeautifulSoupで扱う
soup = BeautifulSoup(res.text, "html.parser")

print(soup)

--実行結果


<!DOCTYPE html>
<html><head><meta charset="utf-8"/><title>Qiita</title><meta content="Qiitaは、プログラマのための技術情報共有サービスです。 プログラミングに関するTips、ノウハウ、メモを簡単に記録 &amp;amp; 公開することができます。" name="description"/><meta content="width=device-width,initial-scale=1,shrink-to-fit=no" name="viewport"/><meta content="#55c500" name="theme-color"/><meta content="XWpkTG32-_C4joZoJ_UsmDUi-zaH-hcrjF6ZC_FoFbk" name="google-site-verification"/><link href="/manifest.json" rel="manifest"/><link href="/opensearch.xml" rel="search" title="Qiita" type="application/opensearchdescription+xml"/><meta content="authenticity_token" name="csrf-param"/>
<meta content="6mrcOYXIEeUhyG/gJ61dUdg/NsvpuwfCgOeEZkJatjtuJk1l/rO1UgSUnZmwzrjNTEW8vzalQnv4/B57bHRB7w==" name="csrf-token"/><link href="https://cdn.qiita.com/assets/favicons/public/production-4ff10c1e1e2b5fcb353ff9cafdd56c70.ico" rel="shortcut icon" type="image/x-icon"/><link href="https://cdn.qiita.com/assets/favicons/public/apple-touch-icon-f9a6afad761ec2306e10db2736187c8b.png" rel="apple-touch-icon" type="image/png"/><link href="https://cdn.qiita.com/assets/public/style-fa51031b7b2e4068805b19f3b5b0ab40.min.css" media="all" rel="stylesheet"/><script defer="" src="https://cdn.polyfill.io/v2/polyfill.min.js"></script><script defer="defer" src="https://cdn.qiita.com/assets/public/bundle-16b878edbdebd67b417fa861cc743c7f.min.js"></script><meta content="summary" name="twitter:card"/><meta content="@Qiita" name="twitter:site"/><meta content="website" property="og:type"/><meta content="プログラマの技術情報共有サービス - Qiita" property="og:title"/><meta content="https://cdn.qiita.com/assets/qiita-fb-2887e7b4aad86fd8c25cea84846f2236.png" property="og:image"/><meta content="Qiitaは、プログラマのための技術情報共有サービスです。 プログラミングに関するTips、ノウハウ、メモを簡単に記録 &amp;amp; 公開することができます。" property="og:description"/><meta content="https://qiita.com/" property="og:url"><meta content="Qiita" property="og:site_name"><meta content="564524038" property="fb:admins"/></meta></meta></head><body><div class="allWrapper"><div data-hyperapp-app="GlobalHeader" data-hyperapp-props='{"unreadNotificationsCount":null,"realms":[{"humanName":"Qiita","isCurrentRealm":true,"isQiita":true,"isQiitaTeam":false,"loggedInUser":null,"teamId":null,"url":"https://qiita.com/"}],"teamFindUrl":"https://teams-center.qiita.com/find_team","isTeamOnlyUser":null,"currentUser":null}'><div class="st-Header" id="globalHeader"><div class="st-Header_container"><div class="st-Header_start"><a class="st-Header_logo mr-1" href="/"><svg viewbox="0 0 75 25" xmlns="http://www.w3.org/2000/svg"><title>Qiita</title><path d="M24.6 12.2C24.6 6.2 20 0 12.2 0 6.2 0 0 4.6 0 12.4c0 6 4.6 12.2 12.4 12.2 2.5 0 5-.8 7.1-2.3l3.6 3.6 1.6-1.6-3.4-3.4c2.1-2.3 3.3-5.3 3.3-8.7zm-12.4-10c5.7 0 10.2 4.4 10.2 10.1 0 4.9-3.8 10.1-10.1 10.1s-10.1-5.1-10.1-10c0-6.4 5.1-10.2 10-10.2zM30.5 7.1h2.1v17h-2.1zM31.5 4.8c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8 1.8.8 1.8 1.8-.8 1.8-1.8 1.8zM40 4.8c-1 0-1.8-.8-1.8-1.8S39 1.2 40 1.2s1.8.8 1.8 1.8S41 4.8 40 4.8zM39 7.1h2.1v17H39zM53.7 24.4c-3.9 0-6.2-3-6.2-6v-16h2.1v4.7H57v2.1h-7.4v9.3c0 1.9 1.5 3.9 4.1 3.9.7 0 1.4-.2 2-.6l.2-.1 1 1.8-.2.1c-.9.5-2 .8-3 .8zM67.6 24.5c-5.7 0-9.1-4.5-9.1-8.9 0-5.7 4.5-9.1 8.9-9.1 2.3 0 4.1.8 5.4 2.3V7.1h2.1v17h-2.1v-1.9c-1.2 1.5-3 2.3-5.2 2.3zm-.2-15.9c-3.4 0-6.8 2.6-6.8 7 0 3.4 2.6 6.8 7 6.8 2 0 4-.9 5.3-2.5v-8.8c-1.4-1.6-3.3-2.5-5.5-2.5z"></path></svg></a><div><div class="st-Header_realmSelector"><span class="fa fa-fw fa-caret-down"></span></div></div><div><div class="st-Header_community">Community<span class="fa fa-fw fa-caret-down ml-1of2"></span></div></div><form class="st-Header_search"><span class="fa fa-search"></span><input class="st-Header_searchInput" placeholder="Search" type="search"/></form><div class="st-Header_searchButton"><span class="fa fa-serach"></span></div></div><div class="st-Header_end"><a class="st-Header_signupButton" href="/signup">Signup</a><a class="st-Header_loginLink" href="/login">Login</a></div></div></div></div><div class="st-HeaderAlert st-HeaderAlert-warning"><div class="st-HeaderAlert_body"></div></div><div class="p-home is-anonymous"><div class="nl-Hero"><div class="nl-Hero_inner"><div class="nl-Hero_start"><h1 class="mb-3 nl-Hero_title">Hello hackers !</h1><p class="nl-Hero_lead">Qiita is a social knowledge sharing for software engineers. Let's share your knowledge or ideas to the world.</p></div><div class="nl-Hero_end"><div class="nl-SocialSignupWrapper"><a class="nl-SocialSignup nl-SocialSignup-github" href="https://oauth.qiita.com/auth/github?callback_action=login_or_signup&amp;realm=qiita"><span class="fa fa-github"></span>GitHub</a><a class="nl-SocialSignup nl-SocialSignup-twitter" href="https://oauth.qiita.com/auth/twitter?callback_action=login_or_signup&amp;realm=qiita"><span class="fa fa-twitter"></span>Twitter</a><a class="nl-SocialSignup nl-SocialSignup-google" href="https://oauth.qiita.com/auth/google?callback_action=login_or_signup&amp;realm=qiita"><span class="fa fa-google"></span>Google</a></div><div class="nl-Hero_separator">OR</div><form accept-charset="UTF-8" action="/registration" class="nl-SignupForm" method="post"><input name="utf8" type="hidden" value="✓"/><input name="authenticity_token" type="hidden" value="9UwzTIrFtVIw/ymQaZaGufy+FkyblFkRrtGo4SHB6BqDdUCzO5R5+TYRPwbB8ANzp40A0dtI2qBwMMU9rHM94g=="/><div class="mb-2 nl-SignupForm_group"><label class="nl-SignupForm_label" for="url_name">user name</label><input class="nl-SignupForm_input" id="url_name" name="user[url_name]" placeholder="qiitan" type="text"/></div><div class="mb-2 nl-SignupForm_group"><label class="nl-SignupForm_label" for="email">mail</label><input class="nl-SignupForm_input" id="email" name="user[email]" placeholder="qiitan@qiita.com" type="email"/></div><div class="mb-1 nl-SignupForm_group"><label class="nl-SignupForm_label" for="password">password</label><input class="nl-SignupForm_input" id="password" name="user[password]" placeholder="********" type="password"/></div><span class="mb-2 nl-SignupForm_helpText">Use at least 8 letters</span><script async="async" defer="defer" src="https://www.google.com/recaptcha/api.js"></script><div class="nl-SignupForm_recaptcha"><script async="" defer="" src="https://www.google.com/recaptcha/api.js"></script>
<div class="g-recaptcha " data-sitekey="6LfNkiQTAAAAAM3UGnSquBy2akTITGNMO_QDxMw6"></div>
<noscript>
<div>
<div style="width: 302px; height: 422px; position: relative;">
<div style="width: 302px; height: 422px; position: absolute;">
<iframe frameborder="0" scrolling="no" src="https://www.google.com/recaptcha/api/fallback?k=6LfNkiQTAAAAAM3UGnSquBy2akTITGNMO_QDxMw6" style="width: 302px; height:422px; border-style: none;">
</iframe>
</div>
</div>
<div style="width: 300px; height: 60px; border-style: none;
                bottom: 12px; left: 25px; margin: 0px; padding: 0px; right: 25px;
                background: #f9f9f9; border: 1px solid #c1c1c1; border-radius: 3px;">
<textarea class="g-recaptcha-response" id="g-recaptcha-response" name="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1;
                  margin: 10px 25px; padding: 0px; resize: none;" value="">
                </textarea>
</div>
</div>
</noscript>
</div><div class="nl-SignupForm_buttonArea"><div class="nl-SignupForm_button"><button>Signup</button></div><div class="nl-SignupForm_attention">By clicking 'Signup', you agree to our <a href="/terms">terms of service</a>.</div></div></form></div></div></div><div class="px-2 px-1@s pt-4 pt-1@s"><div class="p-home_container"><div class="p-home_menu pt-1"><a class="p-home_menuItem p-1 pl-2 pl-1@s mb-1 p-home_menuItem-active" href="/"><span class="fa fa-fw fa-line-chart mr-1of2"></span>Trends</a><a class="p-home_menuItem p-1 pl-2 pl-1@s mb-1" href="/milestones"><span class="fa fa-fw fa-flag-checkered mr-1of2"></span>Milestones</a><div class="p-home_mobileMenu"><select class="p-home_mobileMenuDropdown pl-2 pt-1 pb-1 mb-1" onchange="location.href=value;"><option class="p-home_mobileMenuItem" selected="selected" value="/">Trends</option><option class="p-home_mobileMenuItem" value="/milestones">Milestones</option></select></div></div><div class="p-home_main mb-3 mr-0@s"><div data-hyperapp-app="Trend" data-hyperapp-props="{&quot;trend&quot;:{&quot;edges&quot;:[{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T10:15:47Z&quot;,&quot;likesCount&quot;:891,&quot;title&quot;:&quot;エンジニアが活用したい情報リソースまとめ&quot;,&quot;uuid&quot;:&quot;eb8f28223c9c2926b44f&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F198150%2Fprofile-images%2F1537780652?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=f53cb74c00741a3d965e27fce11ebe37&quot;,&quot;urlName&quot;:&quot;EaE&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T15:07:07Z&quot;,&quot;likesCount&quot;:245,&quot;title&quot;:&quot;「何がわからないのかわからない」は何がわからないのか&quot;,&quot;uuid&quot;:&quot;745ecc0b604fd71177df&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fpbs.twimg.com%2Fprofile_images%2F1146632882812665856%2Fu7UHkJSd_bigger.jpg?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=96374b0112d55fb38deacd8b3febc9eb&quot;,&quot;urlName&quot;:&quot;K_Noko_224&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T09:50:11Z&quot;,&quot;likesCount&quot;:311,&quot;title&quot;:&quot;「ループ・再帰・gotoを使わず1から100までの数値を印字する」Conner Davis 氏の回答の考察&quot;,&quot;uuid&quot;:&quot;19d07c629852876da401&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F8760%2Fprofile-images%2F1473681145?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=a1f08746f7f3cc1783acd6d04d4cf1cf&quot;,&quot;urlName&quot;:&quot;xtetsuji&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T04:29:59Z&quot;,&quot;likesCount&quot;:257,&quot;title&quot;:&quot;開発者なら知っておくべき 11 のコンソールコマンド&quot;,&quot;uuid&quot;:&quot;abe4adb81750e13362e2&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F407975%2Fprofile-images%2F1566911067?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=c3aaa453f55f6123f0602e4da9ac8f8e&quot;,&quot;urlName&quot;:&quot;baby-degu&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T02:35:23Z&quot;,&quot;likesCount&quot;:234,&quot;title&quot;:&quot;【SES】ドナドナされる時の面談時に地雷案件をなるべく避けるための確認ポイント7選(iOS/Androidアプリ開発)&quot;,&quot;uuid&quot;:&quot;1623879a0d3c87d23960&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F68288%2F94d8616b7db54a471885d89b9bd4938f1bee1f83%2Flarge.png%3F1475021009?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=26f41dcc659c0bef8a80be2fe95a08b4&quot;,&quot;urlName&quot;:&quot;homunuz&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T16:04:24Z&quot;,&quot;likesCount&quot;:129,&quot;title&quot;:&quot;Terraformアンチパターン(2019年版)&quot;,&quot;uuid&quot;:&quot;7d80d149e3fb3494c1d4&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Favatars2.githubusercontent.com%2Fu%2F24871281%3Fv%3D4?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=3a78e3e2effe8f8b493f4fb77d4d5726&quot;,&quot;urlName&quot;:&quot;m22r&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T09:49:01Z&quot;,&quot;likesCount&quot;:64,&quot;title&quot;:&quot;【データサイエンス向け】Jupyterチートシート(随時更新)【Jupyter Notebook/Lab】&quot;,&quot;uuid&quot;:&quot;0f5dd484fc5438a3bafc&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Favatars0.githubusercontent.com%2Fu%2F17490886%3Fv%3D3?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=b7ac22509468739f1391e59d9ce18d72&quot;,&quot;urlName&quot;:&quot;syunyo&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T16:42:17Z&quot;,&quot;likesCount&quot;:41,&quot;title&quot;:&quot;【忘年会に向け】オールスター感謝祭的な四択クイズウェブシステムをNuxt.js+Socket.IOで実装してみた&quot;,&quot;uuid&quot;:&quot;50277f527f6e6dbc6d4b&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F136889%2Fprofile-images%2F1550885068?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=13605858e1943cce04277056334125a3&quot;,&quot;urlName&quot;:&quot;majirou&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T08:05:35Z&quot;,&quot;likesCount&quot;:44,&quot;title&quot;:&quot;データ抽出=作業、と扱われないためにするべき3つのこと&quot;,&quot;uuid&quot;:&quot;bca79b456d37a6f1b573&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F311026%2Fprofile-images%2F1543494526?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=af0d9cbd5621428e0f2138b9a1c4e537&quot;,&quot;urlName&quot;:&quot;k_0120&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T09:41:18Z&quot;,&quot;likesCount&quot;:38,&quot;title&quot;:&quot;Flutterをプロダクション導入しました。&quot;,&quot;uuid&quot;:&quot;21a6111b36b98cac3100&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F315364%2Fprofile-images%2F1542871594?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=a662619fdc247eb7660f992d05ca9257&quot;,&quot;urlName&quot;:&quot;navitime_tech&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T04:24:00Z&quot;,&quot;likesCount&quot;:34,&quot;title&quot;:&quot;年末まで毎日webサイトを作り続ける大学生 〜41日目 要素が画面内に入るとふわっとフェードインさせる〜&quot;,&quot;uuid&quot;:&quot;358466eaa6fbd6c0e01e&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F516248%2Fb568bea39c5fdebbd20e1bda8e4037cde9bc11e8%2Flarge.png%3F1571436251?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=d085cced4d8c9da25ac800616116c8c5&quot;,&quot;urlName&quot;:&quot;70days_js&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T23:21:00Z&quot;,&quot;likesCount&quot;:32,&quot;title&quot;:&quot;ZEIT Nowで静的サイトの速度を15倍改善した話&quot;,&quot;uuid&quot;:&quot;846b9d5c02a387756d3e&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F14275%2Fprofile-images%2F1527596243?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=649fbc8587e6b00e07792a0473b91410&quot;,&quot;urlName&quot;:&quot;tomoyamachi&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-26T23:56:45Z&quot;,&quot;likesCount&quot;:73,&quot;title&quot;:&quot;AWS LambdaのDestinationsを試してみる&quot;,&quot;uuid&quot;:&quot;efcb2ac3d5cc176534ba&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F102769%2Fprofile-images%2F1482147140?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=70d352cc429d29280d1bb539e7427a84&quot;,&quot;urlName&quot;:&quot;kojiisd&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T14:06:34Z&quot;,&quot;likesCount&quot;:26,&quot;title&quot;:&quot;CloudNative Days Kansai 2019 発表資料一覧&quot;,&quot;uuid&quot;:&quot;19683ab673868364b129&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F61641%2Fprofile-images%2F1531494058?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=58770c1bffefd357eea9dcb7f14604b2&quot;,&quot;urlName&quot;:&quot;shibataka000&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T09:43:51Z&quot;,&quot;likesCount&quot;:31,&quot;title&quot;:&quot;Swift未経験者が1日でアプリを作った話&quot;,&quot;uuid&quot;:&quot;69503027d69ab02c131c&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F172491%2Fprofile-images%2F1560220056?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=cb9864a556d1dc95d7b063308755aace&quot;,&quot;urlName&quot;:&quot;Close_the_World&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T00:59:22Z&quot;,&quot;likesCount&quot;:24,&quot;title&quot;:&quot;【随時更新】理論研究者に役立つ記事まとめ&quot;,&quot;uuid&quot;:&quot;8b551ebb1738bc9c290e&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F403437%2Fprofile-images%2F1575075110?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=8a6042f857ab22ff31034430888a9afe&quot;,&quot;urlName&quot;:&quot;kumamupooh&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-26T20:35:59Z&quot;,&quot;likesCount&quot;:70,&quot;title&quot;:&quot;C#でAES暗号化アルゴリズムを外部ライブラリに一切頼らず完全実装してみた&quot;,&quot;uuid&quot;:&quot;ab0792aa1e8948b57490&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F535270%2F3e59522dfca791fd0ce7f98d863a9a796ca95a16%2Flarge.png%3F1574159780?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=de7812005bb01c1b7a282eb82a340c9f&quot;,&quot;urlName&quot;:&quot;kkent030315&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T13:03:40Z&quot;,&quot;likesCount&quot;:40,&quot;title&quot;:&quot;jqコマンドでAtCoder Beginners Selectionを解いてみた&quot;,&quot;uuid&quot;:&quot;015459bc96f11626f99b&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F211640%2Fprofile-images%2F1546179543?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=1e6741d59740681be4ee2892d0dc6691&quot;,&quot;urlName&quot;:&quot;yuchiki1000yen&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T10:13:24Z&quot;,&quot;likesCount&quot;:23,&quot;title&quot;:&quot;Kotlin+Realm+RecyclerViewを使ってTodoアプリを作る&quot;,&quot;uuid&quot;:&quot;5ab92ebce46c9479876b&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F152658%2Fprofile-images%2F1541210732?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=1c295d407e2575d6535fce63825b56e8&quot;,&quot;urlName&quot;:&quot;konatsu_p&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T10:44:01Z&quot;,&quot;likesCount&quot;:17,&quot;title&quot;:&quot;【Laravel5.8】PHP7.4でTrying to access array offset on valueが山盛り出るようになった&quot;,&quot;uuid&quot;:&quot;eef7c214b8bf692a5eeb&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F26088%2Fprofile-images%2F1565015744?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=293b9d61eea9649daf72d23b4edff2cd&quot;,&quot;urlName&quot;:&quot;rana_kualu&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-26T11:39:59Z&quot;,&quot;likesCount&quot;:41,&quot;title&quot;:&quot;Pythonで一般相対性理論:導入編&quot;,&quot;uuid&quot;:&quot;2c815aed66647c46bcc5&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F151286%2F4c26758c5a6639adbef970d8e747869ddb8bece5%2Flarge.png%3F1574926292?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=e20a7a7b7525fb083c3135cfedc65ecc&quot;,&quot;urlName&quot;:&quot;Takk_physics&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T14:48:18Z&quot;,&quot;likesCount&quot;:28,&quot;title&quot;:&quot;Nuxt.js+Herokuを使って布団の温度をLINE LIFFで見る #SleepTech&quot;,&quot;uuid&quot;:&quot;1044e4ee96e6868ae17e&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F90087%2Fprofile-images%2F1574684737?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=f99d163871baa6464884cbeabbcfa384&quot;,&quot;urlName&quot;:&quot;tmisuo0423&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T03:53:29Z&quot;,&quot;likesCount&quot;:39,&quot;title&quot;:&quot;Amazon CloudWatch Synthetics を試してみた&quot;,&quot;uuid&quot;:&quot;4c8562b51e1fb9d66e6a&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F16369%2Fprofile-images%2F1500426774?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=b67017475a97e25ed19e64fb04995b17&quot;,&quot;urlName&quot;:&quot;hoto17296&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T06:58:39Z&quot;,&quot;likesCount&quot;:13,&quot;title&quot;:&quot;【Rails】もっと早く知りたかったデバッグ用gem 'better_errors','binding_of_caller'&quot;,&quot;uuid&quot;:&quot;a6f9a939dce25b2d9a3e&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F483292%2Fprofile-images%2F1572131069?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=35b84c6b19d5e26a6a89dfadc9d55538&quot;,&quot;urlName&quot;:&quot;terufumi1122&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:true,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-29T07:09:11Z&quot;,&quot;likesCount&quot;:9,&quot;title&quot;:&quot;【Cloud Native Days Kansai 2019】参加記録&quot;,&quot;uuid&quot;:&quot;9a657766221edeae7965&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F54853%2Fprofile-images%2F1540951561?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=8247c305c92716b9cc7c4782499f0284&quot;,&quot;urlName&quot;:&quot;tzkoba&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:true,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-29T09:42:28Z&quot;,&quot;likesCount&quot;:8,&quot;title&quot;:&quot;VHDLユーザがSystemVerilogでハマったところの記録&quot;,&quot;uuid&quot;:&quot;2e175edfb0759b86f82f&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F313464%2Fprofile-images%2F1550668423?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=10a8e6c0d9e542d241d92fa0da65a9bc&quot;,&quot;urlName&quot;:&quot;ryo_i6&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-27T06:24:49Z&quot;,&quot;likesCount&quot;:16,&quot;title&quot;:&quot;一人でVIPERアーキテクチャーでiOSスマホアプリ開発した感想 まとめ&quot;,&quot;uuid&quot;:&quot;30e44e4f4c9cf733d843&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F68288%2F94d8616b7db54a471885d89b9bd4938f1bee1f83%2Flarge.png%3F1475021009?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=26f41dcc659c0bef8a80be2fe95a08b4&quot;,&quot;urlName&quot;:&quot;homunuz&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:true,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-29T08:15:59Z&quot;,&quot;likesCount&quot;:17,&quot;title&quot;:&quot;こんな人は伸びない!プログラミング初学者がやりがちなダメ勉強法について&quot;,&quot;uuid&quot;:&quot;dcd90203422dd7185bdb&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F392337%2Fe5877917f11508cc010237dcdb449a830282b52a%2Fx_large.png%3F1574745216?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=cb3d9641140d210a1a5fcac69832bc37&quot;,&quot;urlName&quot;:&quot;shimajiri&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:false,&quot;hasCodeBlock&quot;:true,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T23:56:05Z&quot;,&quot;likesCount&quot;:7,&quot;title&quot;:&quot;Spring MVCのRestControllerのRequestParamで任意のEnumをコードなどの別の値で受け取る方法&quot;,&quot;uuid&quot;:&quot;ff3338c34ce59c20bd5f&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F306730%2Fprofile-images%2F1540460519?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=81f9a05bf1e2d5120521713f627be4b7&quot;,&quot;urlName&quot;:&quot;yushi_koga&quot;}}},{&quot;followingLikers&quot;:[],&quot;isLikedByViewer&quot;:false,&quot;isNewArrival&quot;:true,&quot;hasCodeBlock&quot;:false,&quot;node&quot;:{&quot;createdAt&quot;:&quot;2019-11-28T16:24:19Z&quot;,&quot;likesCount&quot;:16,&quot;title&quot;:&quot;エンジニアにオススメしたいyoutuber&quot;,&quot;uuid&quot;:&quot;c2f8bd9a8ab14692bb32&quot;,&quot;author&quot;:{&quot;profileImageUrl&quot;:&quot;https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F264684%2Fdbb248c95cac38e52bd8e52b919976ba3c5871b1%2Flarge.png%3F1574611261?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=07ba0f52714099e4240edb1513d721af&quot;,&quot;urlName&quot;:&quot;seiyatakahashi&quot;}}}]},&quot;scope&quot;:&quot;daily&quot;}"></div></div><div class="p-home_aside"><div class="p-home_ad"><div data-hyperapp-app="GPTSlot" data-hyperapp-props='{"id":"home-side-ad","adUnitPath":"/383564218/p_qiita_300x250_anonymous_feed_sidebar-top","size":[300,250]}'></div></div><div data-hyperapp-app="Announcement" data-hyperapp-props='{"announcement":{"id":"QW5ub3VuY2VtZW50LTEz","title":"Qiita利用規約改訂のお知らせ","body":"\u003cp\u003eユーザー体験の向上のため、Qiita利用規約第11条の内容に追加を行います。\u003cbr\u003e(2019年11月27日 改定)\u003cbr\u003e\u003cbr\u003e\nどの部分をなぜ改定するのか、詳細はこちらの記事をご覧ください。\u003c/p\u003e\n","detailUrl":"https://blog.qiita.com/revision-of-terms-article11/?utm_source=qiita\u0026utm_medium=announce","isStaffOnly":false,"isReadByViewer":false}}'></div><div data-hyperapp-app="QiitaZineFeed" data-hyperapp-props="{}"></div><div data-hyperapp-app="UserRanking" data-hyperapp-props='{"userRanking":{"edges":[{"score":1215,"node":{"name":"baby degu","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F407975%2Fprofile-images%2F1566911067?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=c3aaa453f55f6123f0602e4da9ac8f8e","urlName":"baby-degu"}},{"score":850,"node":{"name":"@EaE","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F198150%2Fprofile-images%2F1537780652?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=f53cb74c00741a3d965e27fce11ebe37","urlName":"EaE"}},{"score":653,"node":{"name":"Sasaki","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Favatars1.githubusercontent.com%2Fu%2F18733090%3Fv%3D4?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=ea49ad0b7924ae284b846aa5f558e61f","urlName":"goemp"}},{"score":462,"node":{"name":"Junichi Fujinuma","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fs3-ap-northeast-1.amazonaws.com%2Fqiita-image-store%2F0%2F430294%2F5178a5b94eda54f10ff8c5cf7a5e8e7c444bf42c%2Fx_large.png%3F1569383329?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=62bfed81f4ee1de1dc276d154c0fa922","urlName":"fujinumagic"}},{"score":455,"node":{"name":"ゴリラ","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F66178%2Fprofile-images%2F1561294746?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=fe78a57e19406fc65ebb43cfe736e8fb","urlName":"gorilla0513"}},{"score":440,"node":{"name":"","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F26088%2Fprofile-images%2F1565015744?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=293b9d61eea9649daf72d23b4edff2cd","urlName":"rana_kualu"}},{"score":411,"node":{"name":"","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.amazonaws.com%2F0%2F55077%2Fprofile-images%2F1526397030?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=11c47c0764213b2cf951fea74dc63f8b","urlName":"teradonburi"}},{"score":392,"node":{"name":"","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F309745%2Fprofile-images%2F1566716125?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=75acb3d6da3fc226da05fa3f37150b73","urlName":"keeey999"}},{"score":358,"node":{"name":"","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Favatars1.githubusercontent.com%2Fu%2F19924936%3Fv%3D4?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=81724a31e83f0b9fa0bed01d9bc6a5a8","urlName":"ufield"}},{"score":350,"node":{"name":"Koto Furumiya","profileImageUrl":"https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F64859%2Fprofile-images%2F1574522863?ixlib=rb-1.2.2\u0026auto=compress%2Cformat\u0026lossless=0\u0026w=48\u0026s=3bc0a583a635be5d0d60438740f1bfe2","urlName":"kfurumiya"}}]},"scope":"WEEKLY"}'></div><div data-hyperapp-app="TagRanking" data-hyperapp-props='{"tagRanking":{"edges":[{"score":256,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/ceafd5ce024e312de9e893ce876ec89995ec3a7f/medium.jpg?1559694099","name":"Python","urlName":"python"}},{"score":163,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/353fa0bbbfd79c4e8837b9c0b13232d80c32c6e8/medium.jpg?1554029821","name":"Rails","urlName":"rails"}},{"score":163,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/7e67c6a2d1e2fc39283fe28cfd5f065b93bbb15a/medium.jpg?1554725663","name":"JavaScript","urlName":"javascript"}},{"score":127,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/f9384932787d996b6e1ed26d7d0b2bc2a9e36441/medium.jpg?1443704516","name":"初心者","urlName":"%e5%88%9d%e5%bf%83%e8%80%85"}},{"score":116,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/6ce673b37ed24f77635fd6ec1b2664160c82b1c9/medium.jpg?1544599978","name":"Ruby","urlName":"ruby"}},{"score":104,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/b871970ded17b8af635a100cd45b4d701419a122/medium.jpg?1574663257","name":"PHP","urlName":"php"}},{"score":96,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/00f6ce83b6ee54dc44dd953fccd436d467de2766/medium.jpg?1558892430","name":"AWS","urlName":"aws"}},{"score":86,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/30af4a22607c5936f3ac647331e94978f6feb20a/medium.jpg?1462785908","name":"Python3","urlName":"python3"}},{"score":75,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/86890d8441752d26572afd242a19907002ce877e/medium.jpg?1559872881","name":"Docker","urlName":"docker"}},{"score":75,"node":{"mediumIconUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-tag-image/1bfaf60121121d7dec866c83d4c4453347ec93e2/medium.jpg?1436171387","name":"Java","urlName":"java"}}]},"scope":"WEEKLY"}'></div><div data-hyperapp-app="OrganizationRanking" data-hyperapp-props='{"organizationRanking":{"edges":[{"score":14,"node":{"name":"IoTLT","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/67955531570736d618f59dd5e615b01285b22217/original.jpg?1485315227","urlName":"iotlt"}},{"score":11,"node":{"name":"株式会社ゆめみ","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/0190460b4c89699a7fb39ef12ae29108a8be6a5c/original.jpg?1392785329","urlName":"yumemi"}},{"score":11,"node":{"name":"アイレット株式会社(cloudpack)","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/b96f2cf7abab99053ed76cc32c0b34ff96d7018a/original.jpg?1405472933","urlName":"cloudpack"}},{"score":10,"node":{"name":"株式会社エクストランス","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/e041a3dcf46ed72645ed53f727b25f4ca3d9ae8b/original.jpg?1574242500","urlName":"x-trans"}},{"score":10,"node":{"name":"株式会社トップゲート","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/f34a0a3e5aaaa516181ffc04f22486cd8abfd9b8/original.jpg?1390363920","urlName":"topgate"}},{"score":9,"node":{"name":"運営者ギルド","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/3fd54146cf16402656ade1852e0d1bcbe8b30ad8/original.jpg?1570259460","urlName":"admin-guild"}},{"score":8,"node":{"name":"株式会社ガイアックス","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/646b13eb1e51a484163f320913d23a40d3f40fe1/original.jpg?1468893400","urlName":"gaiax"}},{"score":8,"node":{"name":"fukuoka.ex (福岡Elixirコミュ)","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/8897385058d4d3d723b2eda49c1e0b784f07f6cb/original.jpg?1532652872","urlName":"fukuokaex"}},{"score":7,"node":{"name":"プロトアウトスタジオ","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/7c7925faf150fc608840d63309ee2c9e933c9827/original.jpg?1561535995","urlName":"protoout-studio"}},{"score":7,"node":{"name":"株式会社Wiz","logoUrl":"https://s3-ap-northeast-1.amazonaws.com/qiita-organization-image/70cd487d8a14a94b657b4590d8c683cabc590d74/original.jpg?1565075253","urlName":"wiz_inc"}}]},"scope":"WEEKLY"}'></div><div data-hyperapp-app="CommunitySponserList" data-hyperapp-props='{"sponsers":[{"alt":"転職ドラフト","src":"//cdn.qiita.com/assets/public/community-sponsers/001_job-draft-95d1738aa7b1e2977654db64e6137362.png","link":"https://job-draft.jp/?utm_source=qiita\u0026utm_medium=tg\u0026utm_term=sponsor\u0026utm_campaign=attention\u0026utm_content=top"},{"alt":"Amazon Web Services","src":"//cdn.qiita.com/assets/public/community-sponsers/007_aws-c0c529d8a8a6ac63a2f5a09c8b4d2e7d.png","link":"https://awsproservjapan.splashthat.com/"},{"alt":"ブロックチェーンハブ","src":"//cdn.qiita.com/assets/public/community-sponsers/013_blockchain_hub-64a0e063bf807ae0a70816b134ae5a87.png","link":"https://www.blockchainhub.co.jp/"},{"alt":"SIGNATE","src":"//cdn.qiita.com/assets/public/community-sponsers/015_signate-9bd16e5f3c9829e92f513cee4903a1fe.jpg","link":"https://signate.jp/"}]}'></div></div></div></div></div><footer class="st-Footer px-2 px-1@s pt-1 pt-3@s pb-2" id="globalFooter"><div class="st-Footer_container"><ul class="st-Footer_start"><li class="st-Footer_link"><a class="st-Footer_copyright" href="https://increments.co.jp">© 2011-2019 Increments Inc.</a></li><li class="st-Footer_link"><a href="/terms">Terms</a></li><li class="st-Footer_link"><a href="http://help.qiita.com/ja/articles/qiita-community-guideline" target="_blank">Guideline</a></li><li class="st-Footer_link"><a href="/privacy">Privacy</a></li><li class="st-Footer_link"><a href="https://help.qiita.com">Help</a></li></ul><ul class="st-Footer_end"><li class="st-Footer_link"><a href="/about">About</a></li><li class="st-Footer_link"><a href="/users">Users</a></li><li class="st-Footer_link"><a href="/tags">Tags</a></li><li class="st-Footer_link"><a href="/items">Items</a></li><li class="st-Footer_link"><a href="https://blog.qiita.com">Blog</a></li><li class="st-Footer_link"><a href="/api/v2/docs">API</a></li><li class="st-Footer_link"><a href="https://jobs.qiita.com?utm_source=qiita&amp;utm_medium=referral&amp;utm_content=footer">Qiita Jobs</a></li><li class="st-Footer_link"><a href="https://teams.qiita.com">Qiita:Team</a></li><li class="st-Footer_link"><a href="https://zine.qiita.com?utm_source=qiita&amp;utm_medium=referral&amp;utm_content=footer" target="_blank">Qiita:Zine</a></li><li class="st-Footer_link"><a href="https://qiita.com/ads?utm_source=qiita&amp;utm_medium=referral&amp;utm_content=footer" target="_blank">Advertisement</a></li><li class="st-Footer_link"><a href="/feedback/new">ご意見</a></li></ul></div></footer></div><div class="p-messages"><div data-hyperapp-app="Message" data-hyperapp-props='{"messages":[]}'></div></div><div data-config='{"actionPath":"public/home#index","settings":{"analyticsTrackingId":"UA-24675221-12","mixpanelToken":"17d24b448ca579c365d2d1057f3a1791","assetsMap":{},"csrfToken":"X4QvqrjRUFB9XQ9vYa6ieXzDDIjWZYvFMEQJ4ORJ053byL72w6r051gB/Rb2zUfl6LmG/Al7znxIX5P9ymckSQ==","locale":"en"},"currentUser":null}' id="dataContainer" style="display: none;"></div></body></html>

あ。。。あれ???🤔欲しいtr-itemの部分が存在せえへんぞ!!!どういうこっちゃ!!!!

割とWebサイトをスクレピングしようとするとQiitaのように、アクセスしてもHTMLが描写されるタイミングがズレている場合があります。単純にそういう対策を取っているサイトは少なくありません。

このままでは何も出来へん。。。なんかヒントないか探し中------


うーん。。。。。なんかヒントないかなあ。
....あれ???カスタムデータ属性に記事と同じ内容にJSONが詰め込まれている。。。
Qiita.png

consoleでちょいと試し。。。
Qiita.png

取れているやん!!!!ちゃんとJSON形式で埋め込まれているんやん!!!
実際に取れている値はこんな感じ

{
    "trend": {
        "edges": [
            {
                "followingLikers": [],
                "isLikedByViewer": false,
                "isNewArrival": false,
                "hasCodeBlock": true,
                "node": {
                    "createdAt": "2019-11-23T00:47:30Z",
                    "likesCount": 298,
                    "title": "OpenCV をビジュアルプログラミングできるアプリを Electron + Vue.js で作成",
                    "uuid": "f3dc7d9a4174a2bad007",
                    "author": {
                        "profileImageUrl": "https://qiita-user-profile-images.imgix.net/https%3A%2F%2Favatars1.githubusercontent.com%2Fu%2F19924936%3Fv%3D4?ixlib=rb-1.2.2&auto=compress%2Cformat&lossless=0&w=48&s=81724a31e83f0b9fa0bed01d9bc6a5a8",
                        "urlName": "ufield"
                    }
                }
            },
            {
                "followingLikers": [],
                "isLikedByViewer": false,
                "isNewArrival": false,
                "hasCodeBlock": false,
                "node": {
                    "createdAt": "2019-11-23T15:33:52Z",
                    "likesCount": 207,
                    "title": "グラブルのコミュニティが抱える課題をウェブアプリで解決して1日で6万PVを叩き出したときの話",
                    "uuid": "f0ff43cb7b9d41448a95",
                    "author": {
                        "profileImageUrl": "https://qiita-user-profile-images.imgix.net/https%3A%2F%2Fqiita-image-store.s3.ap-northeast-1.amazonaws.com%2F0%2F64859%2Fprofile-images%2F1574522863?ixlib=rb-1.2.2&auto=compress%2Cformat&lossless=0&w=48&s=3bc0a583a635be5d0d60438740f1bfe2",
                        "urlName": "kfurumiya"
                    }
                }
            }
        ]
    },
    "scope": "daily"
}

光が見えてきたー!!!!!!:dancer_tone2:
URLの構造の部品や、記事のタイトルはtrend.edges.nodeの中にあるみたい。

"node": {
    "createdAt": "2019-11-23T00:47:30Z",
    "likesCount": 298,
    "title": "OpenCV をビジュアルプログラミングできるアプリを Electron + Vue.js で作成",
    "uuid": "f3dc7d9a4174a2bad007",
    "author": {
        "profileImageUrl": "https://qiita-user-profile-images.imgix.net/https%3A%2F%2Favatars1.githubusercontent.com%2Fu%2F19924936%3Fv%3D4?ixlib=rb-1.2.2&auto=compress%2Cformat&lossless=0&w=48&s=81724a31e83f0b9fa0bed01d9bc6a5a8",
        "urlName": "ufield"
    }
}

このJSONを取得すれば余裕で処理書けるわー!!ほんじゃ早速書いていこう!!!

qiita.py
import requests;
from bs4 import BeautifulSoup;

url = "https://qiita.com/"

headers = {
	"User-Agent" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
}

# 空で置いておく
item_json = []
result = []

res = requests.get(url, headers=headers)

# htmlをBeautifulSoupで扱う
soup = BeautifulSoup(res.text, "html.parser")

# JSONがある部分を取得する
items = soup.find(class_="p-home_main")

# JSONがあるデータ属性があったら取得する
for items in soup.find_all():
	if "data-hyperapp-props" in items.attrs:
		item_json.append(items["data-hyperapp-props"])

# jsonをlist化(PHPでいうjson_decode的なやつ)
items = json.loads(item_json[1])

# 欲しいのはnodeというkeyの部分だけなのでこれだけ取得する
for edges in items['trend']['edges']:
    result.append(edges['node'])

for v in result:
  text = 'タイトル:' + v['title'] + '\n'
  text += 'いいね数:' + str(v['likesCount']) + '\n'
  text += 'URL:' + url + v['author']['urlName'] + '/items/' + v['uuid'] + '\n'
  text += '###############################'
  # ログ用に出力
  print(text)

----実行結果

タイトル:エンジニアが活用したい情報リソースまとめ
いいね数:896
URL:https://qiita.com/EaE/items/eb8f28223c9c2926b44f
###############################
タイトル:「何がわからないのかわからない」は何がわからないのか
いいね数:252
URL:https://qiita.com/K_Noko_224/items/745ecc0b604fd71177df
###############################
タイトル:「ループ・再帰・gotoを使わず1から100までの数値を印字する」Conner Davis 氏の回答の考察
いいね数:317
URL:https://qiita.com/xtetsuji/items/19d07c629852876da401
###############################
タイトル:開発者なら知っておくべき 11 のコンソールコマンド
いいね数:258
URL:https://qiita.com/baby-degu/items/abe4adb81750e13362e2
###############################
タイトル:【SES】ドナドナされる時の面談時に地雷案件をなるべく避けるための確認ポイント7選(iOS/Androidアプリ開発)
いいね数:238
URL:https://qiita.com/homunuz/items/1623879a0d3c87d23960
###############################
タイトル:Terraformアンチパターン(2019年版)
いいね数:130
URL:https://qiita.com/m22r/items/7d80d149e3fb3494c1d4

おけい!!!取れたわ!!!!
これをSlackとかに送信しよ!!!!

スクレイピングした結果をSlackに送信する

slackにはWebhookのURLが用意されていて、そのURLを指定すればチャットに簡単に送信することが出来ます。
slackのWebhookのURLの仕方や登録の仕方はブログに書いてるので、もし良ければ見てね!!

≫ PythonでSlackのBotを作成してみよう

上記でスクレイピングで取得した結果をslackに送信するためには、post送信で指定のURLに送ってあげれば良いだけ!!

post.py
web_hook_url = 'https://hooks.slack.com/services/hogehoge/****/*****'

requests.post(web_hook_url, data = json.dumps({
    'text': text, # 送りたい内容
    'username': 'Qiita-Bot',  # botの名前
}));

この内容を上記のプログラムに当て込むと.....

qiita.py
import requests;
from bs4 import BeautifulSoup;

url = 'https://qiita.com/'
web_hook_url = 'slackで取得したhookのURL'

headers = {
	"User-Agent" : "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1"
}

# 空で置いておく
item_json = []
result = []

res = requests.get(url, headers=headers)

# htmlをBeautifulSoupで扱う
soup = BeautifulSoup(res.text, "html.parser")

# JSONがある部分を取得する
items = soup.find(class_="p-home_main")

# JSONがあるデータ属性があったら取得する
for items in soup.find_all():
	if "data-hyperapp-props" in items.attrs:
		item_json.append(items["data-hyperapp-props"])

# jsonをlist化(PHPでいうjson_decode的なやつ)
items = json.loads(item_json[1])

# 欲しいのはnodeというkeyの部分だけなのでこれだけ取得する
for edges in items['trend']['edges']:
    result.append(edges['node'])

for v in result:
  text = 'タイトル:' + v['title'] + '\n'
  text += 'いいね数:' + str(v['likesCount']) + '\n'
  text += 'URL:' + url + v['author']['urlName'] + '/items/' + v['uuid'] + '\n'
  text += '###############################'
  # ログ用に出力
  print(text)

  requests.post(web_hook_url, data = json.dumps({
    'text': text,
    'username': 'Qiita-Bot',
   }));

プログラムちょっと汚いけどまあええやろ!!!!
これを実際に実行すると以下のような感じで無事に送信されます。

post_slack_bash.png

やった!!!!!!!でけたわ!!!!

pandasとかのライブラリを使用すればcsv出力も出来るし、データ収集できそう。
これでわいもQiitaマスター。

16
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?