<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Statistics｜林鼎淵 Dean Lin</title>
    <link>https://deanlin.net/tags/statistics/</link>
    <image><url>https://deanlin.net/images/author_hu_aa256fc934e9a932.jpg</url><title>Statistics｜林鼎淵 Dean Lin</title><link>https://deanlin.net/tags/statistics/</link><width>144</width><height>144</height></image>
    <description>林鼎淵（Dean Lin）的部落格：生成式 AI 企業內訓講師、外商資安公司軟體專家、7 本書作者。400 多篇文章用白話分享生成式 AI 實戰、Claude Code 與 Vibe Coding 教學、團隊合作與職場成長。</description>
    <generator>Hugo</generator>
    <language>zh-tw</language>
    <copyright>© 2020–2026 林鼎淵 Dean Lin</copyright>
    <lastBuildDate>Mon, 03 Jan 2022 17:02:47 +0800</lastBuildDate>
    <atom:link href="https://deanlin.net/tags/statistics/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>3步驟取得自己Medium所有文章的總瀏覽/閱讀/粉絲人數</title>
      <link>https://deanlin.net/blog/202201/medium-total-stats/</link>
      <pubDate>Mon, 03 Jan 2022 17:02:47 +0800</pubDate>
      <guid>https://deanlin.net/blog/202201/medium-total-stats/</guid>
      <dc:creator>林鼎淵</dc:creator>
      <category>技術教學</category>
      <description>我想大部分 Medium 平台的創作者，都應該非常關心自己文章的瀏覽數量；但 Medium 提給供創作者的後台並沒有統計出「總數」這塊的資訊，如果要自己土法煉鋼用計算機加總也會讓人崩潰，今天筆者就帶你們用聰明且快速的方法來取得這份資訊吧！</description>
      <media:content url="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-og_hu_f52bb57df6a1f775.jpg" medium="image" type="image/jpeg" width="1200" height="675" />
      <content:encoded><![CDATA[<p>我想大部分 Medium 平台的創作者，都應該非常關心自己文章的瀏覽數量；但 Medium 提給供創作者的後台並沒有統計出「總數」這塊的資訊，如果要自己土法煉鋼用計算機加總也會讓人崩潰，今天筆者就帶你們用聰明且快速的方法來取得這份資訊吧！</p>
<figure class="figure"><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-01.webp" width="1400" height="784" alt="上面的是 DL 技術世界 這個 Publications 的數據喔～" fetchpriority="high" decoding="async">
  <figcaption>上面的是<a href="https://medium.com/dean-lin"> DL 技術世界</a> 這個 Publications 的數據喔～</figcaption>
</figure>

<blockquote>
<p>建議使用 Chrome 或是 Firefox 來操作下面的步驟</p>
</blockquote>
<h2 id="setp-13進入自己-medium-stats-頁面">SETP 1/3：進入自己 Medium STATS 頁面<a class="h-anchor" href="#setp-13%e9%80%b2%e5%85%a5%e8%87%aa%e5%b7%b1-medium-stats-%e9%a0%81%e9%9d%a2" aria-label="這個段落的連結"></a></h2>
<p>今天提供的方法可以計算自己 STATS 的頁面(<a href="https://medium.com/me/stats">https://medium.com/me/stats</a>)，以及自己有 Owner 權限的 Publications 頁面。</p>
<figure class="figure"><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-02.webp" width="1399" height="985" alt="自己 STATS 的頁面" loading="lazy" decoding="async">
  <figcaption>自己 STATS 的頁面</figcaption>
</figure>

<figure class="figure"><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-03.webp" width="1399" height="985" alt="有 Owner 權限的 Publications 頁面" loading="lazy" decoding="async">
  <figcaption>有 Owner 權限的 Publications 頁面</figcaption>
</figure>

<hr>
<h2 id="setp-23打開瀏覽器的開發者工具developer-tools">SETP 2/3：打開瀏覽器的「開發者工具(developer tools)」<a class="h-anchor" href="#setp-23%e6%89%93%e9%96%8b%e7%80%8f%e8%a6%bd%e5%99%a8%e7%9a%84%e9%96%8b%e7%99%bc%e8%80%85%e5%b7%a5%e5%85%b7developer-tools" aria-label="這個段落的連結"></a></h2>
<p>可以按鍵盤的「F12」或是「滑鼠右鍵 → 檢查」打開瀏覽器的「開發者工具(developer tools)」。</p>
<figure class="figure"><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-04.webp" width="1324" height="988" alt="部落格有很多優質好文(自己在說XD)，歡迎大點閱＆分享＆拍手喔～" loading="lazy" decoding="async">
  <figcaption>部落格有很多優質好文(自己在說XD)，歡迎大點閱＆分享＆拍手喔～</figcaption>
</figure>

<p>開啟後你應該會看到下面的畫面，不要被右邊的程式碼還有下方一堆紅色的警告給嚇到。</p>
<p><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-05.webp" width="1400" height="816" alt="SETP 2/3：打開瀏覽器的「開發者工具(developer tools)」（圖 5）" loading="lazy" decoding="async"></p>
<hr>
<h2 id="setp-33貼上程式碼取得自己-medium-部落格的總瀏覽閱讀粉絲數量">SETP 3/3：貼上程式碼，取得自己 Medium 部落格的總瀏覽/閱讀/粉絲數量！<a class="h-anchor" href="#setp-33%e8%b2%bc%e4%b8%8a%e7%a8%8b%e5%bc%8f%e7%a2%bc%e5%8f%96%e5%be%97%e8%87%aa%e5%b7%b1-medium-%e9%83%a8%e8%90%bd%e6%a0%bc%e7%9a%84%e7%b8%bd%e7%80%8f%e8%a6%bd%e9%96%b1%e8%ae%80%e7%b2%89%e7%b5%b2%e6%95%b8%e9%87%8f" aria-label="這個段落的連結"></a></h2>
<p>你要做的事情很簡單，先將下面的程式碼複製起來。</p>
<div class="highlight"><pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#8b949e;font-style:italic">// 要抓取第幾個欄位的資訊
</span></span></span><span style="display:flex;"><span><span style="color:#ff7b72">const</span> totalTypes <span style="color:#ff7b72;font-weight:bold">=</span> {
</span></span><span style="display:flex;"><span>    VIEWS<span style="color:#ff7b72;font-weight:bold">:</span> <span style="color:#a5d6ff">2</span>,
</span></span><span style="display:flex;"><span>    READS<span style="color:#ff7b72;font-weight:bold">:</span> <span style="color:#a5d6ff">3</span>,
</span></span><span style="display:flex;"><span>    FANS<span style="color:#ff7b72;font-weight:bold">:</span> <span style="color:#a5d6ff">5</span>,
</span></span><span style="display:flex;"><span>};
</span></span><span style="display:flex;"><span><span style="color:#8b949e;font-style:italic">// 根據網頁結構取得資訊，並且加總
</span></span></span><span style="display:flex;"><span><span style="color:#ff7b72">const</span> getTotal <span style="color:#ff7b72;font-weight:bold">=</span> (tableColumn) =&gt; [
</span></span><span style="display:flex;"><span>    ...document.querySelectorAll(
</span></span><span style="display:flex;"><span>        <span style="color:#a5d6ff">`td:nth-child(</span><span style="color:#a5d6ff">${</span>tableColumn<span style="color:#a5d6ff">}</span><span style="color:#a5d6ff">) &gt; span.sortableTable-number`</span>
</span></span><span style="display:flex;"><span>    )].map((e) =&gt;
</span></span><span style="display:flex;"><span>        parseInt(e.getAttribute(<span style="color:#a5d6ff">&#34;title&#34;</span>).replace(<span style="color:#79c0ff">/,/g</span>, <span style="color:#a5d6ff">&#34;&#34;</span>))).reduce((a, b) =&gt; a <span style="color:#ff7b72;font-weight:bold">+</span> b, <span style="color:#a5d6ff">0</span>);
</span></span><span style="display:flex;"><span><span style="color:#8b949e;font-style:italic">// 印出各自的總瀏覽數
</span></span></span><span style="display:flex;"><span>console.log({
</span></span><span style="display:flex;"><span>    totalViews<span style="color:#ff7b72;font-weight:bold">:</span> getTotal(totalTypes.VIEWS),<span style="color:#8b949e;font-style:italic">// 總瀏覽數
</span></span></span><span style="display:flex;"><span>    totalReads<span style="color:#ff7b72;font-weight:bold">:</span> getTotal(totalTypes.READS),<span style="color:#8b949e;font-style:italic">// 總閱讀數
</span></span></span><span style="display:flex;"><span>    totalFans<span style="color:#ff7b72;font-weight:bold">:</span> getTotal(totalTypes.FANS),<span style="color:#8b949e;font-style:italic">// 總粉絲數
</span></span></span><span style="display:flex;"><span>});
</span></span></code></pre></div><p class="code-source">原始碼：<a href="https://gist.github.com/dean9703111/a57fbb67cb29eba87263fedfca7c6378" rel="noopener">get-medium-total.js</a>（GitHub Gist）</p>
<p>然後貼到剛剛瀏覽器的「Console」位置。</p>
<p><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-06.webp" width="1400" height="816" alt="SETP 3/3：貼上程式碼，取得自己 Medium 部落格的總瀏覽/閱讀/粉絲數量！（圖 6）" loading="lazy" decoding="async"></p>
<p>接著按下「Enter」就可以在下方看到經過統計的數字嚕！</p>
<p><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-07.webp" width="1400" height="816" alt="SETP 3/3：貼上程式碼，取得自己 Medium 部落格的總瀏覽/閱讀/粉絲數量！（圖 7）" loading="lazy" decoding="async"></p>
<hr>
<h2 class="h-nomark" id="特別提醒如果你的文章很多請滑至頁面底部再操作">❗特別提醒：如果你的文章很多，請滑至頁面底部再操作<a class="h-anchor" href="#%e7%89%b9%e5%88%a5%e6%8f%90%e9%86%92%e5%a6%82%e6%9e%9c%e4%bd%a0%e7%9a%84%e6%96%87%e7%ab%a0%e5%be%88%e5%a4%9a%e8%ab%8b%e6%bb%91%e8%87%b3%e9%a0%81%e9%9d%a2%e5%ba%95%e9%83%a8%e5%86%8d%e6%93%8d%e4%bd%9c" aria-label="這個段落的連結"></a></h2>
<p>因為 Medium 預設一開始進入頁面只會顯示一部分的文章數據，因此如果你的文章數量很多，<strong>請滑至頁面底部再貼上程式碼</strong>；以筆者的文章為例，若沒有往下滑，得到的數據為：「totalViews: 6140, totalReads: 2905, totalFans: 21」，筆者至今共發表 74 篇文章，儘管非常佛系經營；但如果只有上面的數據真的會痛哭流涕😭😭😭。</p>
<p>我邊滑到頁面底部再做一次操作，透過下圖的數據:：「totalViews: 20597, totalReads: 8871, totalFans: 55」，我們就更得知如果沒滑至底部計算是不準確的喔！</p>
<figure class="figure"><img src="https://deanlin.net/blog/202201/medium-total-stats/images/medium-total-stats-08.webp" width="1400" height="816" alt="這個數據還是好可憐ＱＱ，請讀者多多拍手跟分享；讓筆者寫文章的時候能更有溫暖🙏" loading="lazy" decoding="async">
  <figcaption>這個數據還是好可憐ＱＱ，請讀者多多拍手跟分享；讓筆者寫文章的時候能更有溫暖🙏</figcaption>
</figure>

<blockquote class="pullquote"><p>希望今天這篇文章有幫助到 Medium 的創作者取得相關數據，讓自己更有競爭力 💪</p>
</blockquote>
<p>參考資源：<a href="https://www.kevinpeters.net/how-to-get-total-views-and-reads-statistics-on-medium">How to get total views and reads statistics on Medium</a></p>
]]></content:encoded>
    </item>
  </channel>
</rss>
