{"id":980,"date":"2013-05-03T04:25:17","date_gmt":"2013-05-03T04:25:17","guid":{"rendered":"http:\/\/garysieling.com\/blog\/?p=980"},"modified":"2013-05-03T04:25:17","modified_gmt":"2013-05-03T04:25:17","slug":"extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/","title":{"rendered":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News"},"content":{"rendered":"<p>Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not.<\/p>\n<p>This code example collects the submission statistics for a WordPress blog entry &#8211; Twitter and Google+ posts, Hacker News posts\/votes, and Reddit posts\/upvotes\/downvotes.<\/p>\n<p>The output is a CSV file. Since stories can be submitted to HN and reddit multiple times, this duplicates the URL rows in the output.<\/p>\n<p>You can get the source on <a href=\"https:\/\/github.com\/garysieling\/social_media_counts\">Github here<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/05\/social-media-578x118.png\" alt=\"social-media\" width=\"578\" height=\"118\" class=\"alignnone size-large wp-image-983\" \/><\/p>\n<p>&nbsp;<\/p>\n<pre lang=\"php\">\n&lt;?php function google_plus_count($url) {     $curl = curl_init();     curl_setopt($curl, CURLOPT_URL, \"https:\/\/clients6.google.com\/rpc\");     curl_setopt($curl, CURLOPT_POST, 1);     curl_setopt($curl, CURLOPT_POSTFIELDS, '[{\"method\":\"pos.plusones.get\",\"id\":\"p\",\"params\":{\"nolog\":true,\"id\":\"' . $url . '\",\"source\":\"widget\",\"userId\":\"@viewer\",\"groupId\":\"@self\"},\"jsonrpc\":\"2.0\",\"key\":\"p\",\"apiVersion\":\"v1\"}]');     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);     curl_setopt($curl, CURLOPT_HTTPHEADER, array(         'Content-type: application\/json'     ));     $curl_results = curl_exec($curl);     curl_close($curl);     $json = json_decode($curl_results, true);     $val  = $json[0]['result']['metadata']['globalCounts']['count'];     if ($val) {         return $val;     } else {         return 0;     }     ;      } function twitter_count($url) {     $twitter_url = \"http:\/\/urls.api.twitter.com\/1\/urls\/count.json?url=\" . $url;     $curl        = curl_init();     curl_setopt($curl, CURLOPT_URL, $twitter_url);     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);     curl_setopt($curl, CURLOPT_HTTPHEADER, array(         'Content-type: application\/json'     ));     $curl_results = curl_exec($curl);     curl_close($curl);     $json = json_decode($curl_results, true);     $val  = $json['count'];     if ($val) {         return $val;     } else {         return 0;     }     ; } function hn_count($url) {     $hn_url = 'http:\/\/api.thriftdb.com\/api.hnsearch.com\/items\/_search?filter[fields][url][]=' . $url;     $curl   = curl_init();     curl_setopt($curl, CURLOPT_URL, $hn_url);     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);     curl_setopt($curl, CURLOPT_HTTPHEADER, array(         'Content-type: application\/json'     ));     $curl_results = curl_exec($curl);     curl_close($curl);     $json = json_decode($curl_results, true);          $i = 0;     if ($json['results']) {         $json = $json['results'];                  foreach ($json as $item) {             $item_val = $item['item'];             if ($i &gt; 0) {\n                echo \"\\n$url,,,,\";\n            }\n\n            echo $item_val['points'] . \",\" . $item_val['num_comments'] . \",\" . $item_val['username'] . \",\";\n            $i++;\n        }\n    }\n    if ($i == 0) { \/\/ never submitted\n        echo \",,,\";\n    }\n    \/\/ points num_comments username\n}\n\n$sql = \"select comment_count, post_name from wp_posts where post_type = 'post' and post_status='publish';\";\n\n$hostname = \"127.0.0.1\";\n$username = \"\";\n$password = \"\";\n$db       = \"\";\n\n$reddit_name = \"\";\n$reddit_pass = \"\";\n\n$dbhandle = mysql_connect($hostname, $username, $password);\n$selected = mysql_select_db($db, $dbhandle);\n\n$result = mysql_query($sql);\n\nrequire_once(\"reddit.php\");\n$reddit = new reddit($reddit_name, $reddit_pass);\n\necho \"SLUG,COMMENTS,GOOGLE_PLUS,TWITTER,HN_POINTS,HN_COMMENTS,HN_USER,SUBREDDIT,REDDIT_LIKES,REDDIT_SCORE,REDDIT_DOWNS,REDDIT_UPS,REDDIT_NUM_COMMENTS,REDDIT_SUBMISSION,REDDIT_AUTHOR,HN\\n\";\nwhile ($row = mysql_fetch_array($result)) {\n    $url = \"http:\/\/garysieling.com\/blog\/\" . $row{'post_name'};\n\n    echo $url . \",\" . $row{'comment_count'} . \",\";\n    echo google_plus_count($url) . \",\" . twitter_count($url) . \",\";\n    hn_count($url);\n\n    $pageInfo = $reddit-&gt;getPageInfo($url);\n    $i        = 0;\n    if ($pageInfo and $pageInfo-&gt;data and $pageInfo-&gt;data-&gt;children) {\n        $children = $pageInfo-&gt;data-&gt;children;\n\n        foreach ($pageInfo-&gt;data-&gt;children as $submission) {\n\n            $submission   = $submission-&gt;data;\n            $subreddit    = $submission-&gt;subreddit;\n            $likes        = $submission-&gt;likes;\n            $score        = $submission-&gt;score;\n            $downs        = $submission-&gt;downs;\n            $ups          = $submission-&gt;ups;\n            $num_comments = $submission-&gt;num_comments;\n            $num_reports  = $submission-&gt;num_reports;\n            $author       = $submission-&gt;author;\n\n            if ($i &gt; 0) {\n                echo \"\\n\" . $url . \",\" . $row{'comment_count'};\n                echo \",,,,,,\";\n            }\n\n            echo \"$subreddit,$likes,$score,$downs,$ups,$num_comments,$num_reports,$author\";\n\n            $i++;\n        }\n    }\n\n    echo \" \n\";\n\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a WordPress blog entry &#8211; Twitter and Google+ posts, Hacker News posts\/votes, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[256,266,457,495,509,556],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gary\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gary Sieling - Software Engineer\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling\" \/>\n\t\t<meta property=\"og:description\" content=\"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2013-05-03T04:25:17+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2013-05-03T04:25:17+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#blogposting\",\"name\":\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling\",\"headline\":\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News\",\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"http:\\\/\\\/garysieling.com\\\/blog\\\/wp-content\\\/uploads\\\/2013\\\/05\\\/social-media-578x118.png\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#articleImage\"},\"datePublished\":\"2013-05-03T04:25:17+00:00\",\"dateModified\":\"2013-05-03T04:25:17+00:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#webpage\"},\"articleSection\":\"Data Mining, google plus, hacker news, reddit, scraping, social media, twitter\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/#listItem\",\"name\":\"Data Mining\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/#listItem\",\"position\":2,\"name\":\"Data Mining\",\"item\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#listItem\",\"name\":\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#listItem\",\"position\":3,\"name\":\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/category\\\/data-mining\\\/#listItem\",\"name\":\"Data Mining\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/\",\"name\":\"gary\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"gary\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#webpage\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/\",\"name\":\"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling\",\"description\":\"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\\\/votes,\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/author\\\/gary\\\/#author\"},\"datePublished\":\"2013-05-03T04:25:17+00:00\",\"dateModified\":\"2013-05-03T04:25:17+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/\",\"name\":\"Gary Sieling\",\"description\":\"Software Engineer\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.garysieling.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling","description":"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,","canonical_url":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#blogposting","name":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling","headline":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News","author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"http:\/\/garysieling.com\/blog\/wp-content\/uploads\/2013\/05\/social-media-578x118.png","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#articleImage"},"datePublished":"2013-05-03T04:25:17+00:00","dateModified":"2013-05-03T04:25:17+00:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#webpage"},"isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#webpage"},"articleSection":"Data Mining, google plus, hacker news, reddit, scraping, social media, twitter"},{"@type":"BreadcrumbList","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.garysieling.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/#listItem","name":"Data Mining"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/#listItem","position":2,"name":"Data Mining","item":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#listItem","name":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#listItem","position":3,"name":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News","previousItem":{"@type":"ListItem","@id":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/#listItem","name":"Data Mining"}}]},{"@type":"Organization","@id":"https:\/\/www.garysieling.com\/blog\/#organization","name":"Gary Sieling","description":"Software Engineer","url":"https:\/\/www.garysieling.com\/blog\/"},{"@type":"Person","@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author","url":"https:\/\/www.garysieling.com\/blog\/author\/gary\/","name":"gary","image":{"@type":"ImageObject","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/0be925276d848ffe98a6a9dc8cf33e67?s=96&d=identicon&r=g","width":96,"height":96,"caption":"gary"}},{"@type":"WebPage","@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#webpage","url":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/","name":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling","description":"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.garysieling.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/#breadcrumblist"},"author":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"creator":{"@id":"https:\/\/www.garysieling.com\/blog\/author\/gary\/#author"},"datePublished":"2013-05-03T04:25:17+00:00","dateModified":"2013-05-03T04:25:17+00:00"},{"@type":"WebSite","@id":"https:\/\/www.garysieling.com\/blog\/#website","url":"https:\/\/www.garysieling.com\/blog\/","name":"Gary Sieling","description":"Software Engineer","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.garysieling.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gary Sieling - Software Engineer","og:type":"article","og:title":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling","og:description":"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,","og:url":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/","article:published_time":"2013-05-03T04:25:17+00:00","article:modified_time":"2013-05-03T04:25:17+00:00","twitter:card":"summary_large_image","twitter:title":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News - Gary Sieling","twitter:description":"Ever wonder if your blog posts have been submitted to sites like Reddit or Hacker News, who submitted them, and how well they did? All this data is available through JSON APIs, official or not. This code example collects the submission statistics for a Wordpress blog entry - Twitter and Google+ posts, Hacker News posts\/votes,"},"aioseo_meta_data":{"post_id":"980","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2023-02-04 16:12:28","updated":"2026-07-06 00:53:54","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/\" title=\"Data Mining\">Data Mining<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tExtracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.garysieling.com\/blog"},{"label":"Data Mining","link":"https:\/\/www.garysieling.com\/blog\/category\/data-mining\/"},{"label":"Extracting Social Media Vote Counts for Reddit, Twitter, Google+ and Hacker News","link":"https:\/\/www.garysieling.com\/blog\/extracting-social-media-vote-counts-for-reddit-twitter-google-and-hacker-news\/"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/980"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=980"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/980\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}