{"id":5244,"date":"2017-02-10T00:01:20","date_gmt":"2017-02-09T15:01:20","guid":{"rendered":"http:\/\/www.magtranetwork.com\/?p=5244"},"modified":"2017-02-10T09:46:07","modified_gmt":"2017-02-10T00:46:07","slug":"check_twitter_account_following_followers","status":"publish","type":"post","link":"https:\/\/www.magtranetwork.com\/aws\/check_twitter_account_following_followers.html","title":{"rendered":"Twitter\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d5\u30a9\u30ed\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30fc\u6570\u3068\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u306e\u5dee\u5206\u3092\u53d6\u5f97\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0) \uff5e\u30d5\u30a9\u30ed\u30fc\u6570\u30fb\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u306e\u5897\u6e1b\u306e\u8a18\u9332\u3001\u5b9a\u671f\u7684\u306a\u30e1\u30c8\u30ea\u30af\u30b9\u306e\u767b\u9332\u30fb\u76e3\u8996\u30fb\u5206\u6790\u306b\u4f7f\u3048\u308b\u30d0\u30c3\u30c1\u51e6\u7406\uff5e"},"content":{"rendered":"
\u591a\u304f\u306e\u500b\u4eba\u3001\u4f01\u696d\u3092\u59cb\u3081\u3001\u6570\u3005\u306e\u6709\u540d\u4eba\u304c\u60c5\u5831\u3084\u610f\u898b\u3092\u7c21\u5358\u306b\u767a\u4fe1\u3067\u304d\u308bTwitter\u306f\u4eca\u3084\u5e83\u304f\u666e\u53ca\u3057\u3001\u6642\u4ee3\u306e\u30c8\u30ec\u30f3\u30c9\u3084\u4e16\u8ad6\u306e\u5206\u6790\u306b\u3082\u4f7f\u308f\u308c\u308b\u3088\u3046\u306a\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n
\u4eca\u56de\u306f\u305d\u3093\u306a\u4e16\u306e\u4e2d\u3092\u77e5\u308b\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf\u306e1\u8981\u7d20\u3068\u306a\u3063\u3066\u3044\u308b\u516c\u958bTwitter\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d5\u30a9\u30ed\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u3092\u53ce\u96c6\u3059\u308b\u7c21\u5358\u306a\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n
\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u3067\u30c7\u30fc\u30bf\u3092\u53ce\u96c6\u3059\u308b\u3053\u3068\u3067\u3001\u5bfe\u8c61\u306eTwitter\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d5\u30a9\u30ed\u30fc\u6570\u30fb\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u306e\u5897\u6e1b\u3092\u8a18\u9332\u3057\u305f\u308a\u3001\u5b9a\u671f\u7684\u306bAWS CloudWatch\u306e\u3088\u3046\u306a\u30af\u30e9\u30a6\u30c9\u76e3\u8996\u30c4\u30fc\u30eb\u306b\u30e1\u30c8\u30ea\u30af\u30b9\u3092\u9001\u4fe1\u3057\u3066\u30c7\u30fc\u30bf\u3092\u84c4\u7a4d\u3057\u3001\u76e3\u8996\u30fb\u5206\u6790\u306b\u4f7f\u3046\u306a\u3069\u30d0\u30c3\u30c1\u51e6\u7406\u3068\u7c21\u5358\u306b\u9023\u643a\u3067\u304d\u307e\u3059\u3002<\/p>\n
\u57fa\u672c\u7684\u306a\u65b9\u91dd\u306fTwitter\u306e\u516c\u958b\u30a2\u30ab\u30a6\u30f3\u30c8\u306eURL(https:\/\/twitter.com\/\uff1c@\u3092\u9664\u304f\u30a2\u30ab\u30a6\u30f3\u30c8\u540d\uff1e)\u304b\u3089\u30d5\u30a9\u30ed\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u3092\u53d6\u5f97\u3057\u3066\u5dee\u5206\u3068\u3068\u3082\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n
\u5177\u4f53\u7684\u306a\u51e6\u7406\u3068\u3057\u3066\u306fTwitter\u30a2\u30ab\u30a6\u30f3\u30c8\u306eURL\u306e\u60c5\u5831\u3092curl\u3067\u53d6\u5f97\u3057\u3001\u30d5\u30a9\u30ed\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30fc\u30ef\u30fc\u6570\u306b\u95a2\u3059\u308b\u884c\u304b\u3089\u6b63\u898f\u8868\u73fe\u3067\u6570\u5024\u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/p>\n
\u5dee\u5206\u306b\u3064\u3044\u3066\u306f\u30d5\u30a9\u30ed\u30fc\u6570\u304b\u3089\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u3092\u5f15\u3044\u305f\u5358\u7d14\u306a\u8a08\u7b97\u5024\u3067\u3059\u3002<\/p>\n
\u5165\u529b\u5024\u306eTwitter\u30a2\u30ab\u30a6\u30f3\u30c8\u540d\u306e\u300c@(\u30a2\u30c3\u30c8\u30de\u30fc\u30af)\u300d\u306f\u3042\u3063\u3066\u3082\u7121\u304f\u3066\u3082\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n
\r\n[magtranetwork@localhost ~]# vim check_twitter_follow.sh\r\n<\/pre>\n\r\n#!\/bin\/bash\r\n\r\nTMP_DIR=\/tmp\r\nTMP_FILE=twitter_user_top.txt\r\nTWITTER_URL=https:\/\/twitter.com\r\n\r\nmkdir -p ${TMP_DIR}\r\n\r\nTWITTER_ACCOUNT=$1\r\n\r\nTWITTER_ACCOUNT=`echo "${TWITTER_ACCOUNT}" | sed 's\/@\/\/g'`\r\n\r\nif [ "${TWITTER_ACCOUNT}" = "" ]; then\r\n echo "Usage: $(basename $0) [TWITTER_ACCOUNT]"\r\n exit 1\r\nfi\r\n\r\nTWITTER_URL="${TWITTER_URL}\/${TWITTER_ACCOUNT}"\r\n\r\ncurl -sS ${TWITTER_URL} > ${TMP_DIR}\/${TMP_FILE}\r\n\r\nFOLLOWING=`cat ${TMP_DIR}\/${TMP_FILE} | grep 'data-nav="following"' | sed 's\/[^0-9]\/\/g'`\r\nFOLLOWERS=`cat ${TMP_DIR}\/${TMP_FILE} | grep 'data-nav="followers"' | sed 's\/[^0-9]\/\/g'`\r\n\r\necho "Following: ${FOLLOWING}"\r\necho "Followers: ${FOLLOWERS}"\r\necho "Difference: $((FOLLOWING-FOLLOWERS))"\r\n\r\nrm -rf ${TMP_DIR}\/${TMP_FILE}\r\n<\/pre>\nTwitter\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d5\u30a9\u30ed\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u3001\u30d5\u30a9\u30ed\u30fc\u6570\u3068\u30d5\u30a9\u30ed\u30ef\u30fc\u6570\u306e\u5dee\u5206\u3092\u53d6\u5f97\u3059\u308b\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8(\u30d0\u30c3\u30c1\u51e6\u7406\u30d7\u30ed\u30b0\u30e9\u30e0)\u306e\u4f7f\u7528\u4f8b<\/h3>\n
\r\n[magtranetwork@localhost ~]# check_twitter_follow.sh @magtranetwork\r\nAccount: @magtranetwork\r\nFollowing: 39312\r\nFollowers: 35920\r\nDifference: 3392\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u591a\u304f\u306e\u500b\u4eba\u3001\u4f01\u696d\u3092\u59cb\u3081\u3001\u6570\u3005\u306e\u6709\u540d\u4eba\u304c\u60c5\u5831\u3084\u610f\u898b\u3092\u7c21\u5358\u306b\u767a\u4fe1\u3067\u304d\u308bTwitter\u306f\u4eca\u3084\u5e83\u304f\u666e\u53ca\u3057\u3001\u6642\u4ee3\u306e\u30c8\u30ec\u30f3\u30c9\u3084\u4e16\u8ad6\u306e\u5206\u6790\u306b\u3082\u4f7f\u308f\u308c\u308b\u3088\u3046\u306a\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002 \u4eca\u56de\u306f\u305d\u3093\u306a\u4e16\u306e\u4e2d\u3092\u77e5\u308b\u30d3\u30c3\u30b0\u30c7\u30fc\u30bf […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[3,22,79,82],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/5244"}],"collection":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/comments?post=5244"}],"version-history":[{"count":3,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/5244\/revisions"}],"predecessor-version":[{"id":5263,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/posts\/5244\/revisions\/5263"}],"wp:attachment":[{"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/media?parent=5244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/categories?post=5244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.magtranetwork.com\/wp-json\/wp\/v2\/tags?post=5244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}