Skip to content

Commit

Permalink
📝 fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
budougumi0617 committed Aug 21, 2020
1 parent afde0c9 commit d82b330
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/twitter.ts
@@ -1,6 +1,5 @@
import URLFetchRequestOptions = GoogleAppsScript.URL_Fetch.URLFetchRequestOptions;

// https://yurilog.cc/3375
function getTwitterFollowers(accoutName: string): number {
const url: string = `https://mobile.twitter.com/${accoutName}`;
const postheader: Object = {
Expand All @@ -12,6 +11,7 @@ function getTwitterFollowers(accoutName: string): number {
muteHttpExceptions: true,
};
let html: string = UrlFetchApp.fetch(url, parameters).getContentText("UTF-8");
// curlで取得したHTMLの中から文字列を取得。その文字列をChrome Dev toolsでこねこねして考えた正規表現。
const counts = html.match(/\/followers\">[<>\w\s=/"]*statnum\">(\d+)<\/div>/);
if (counts === null) {
Logger.log("failed parse twitter");
Expand Down

0 comments on commit d82b330

Please sign in to comment.