{"id":33390,"date":"2014-12-15T20:53:54","date_gmt":"2014-12-15T20:53:54","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/twitter-reaper\/"},"modified":"2014-12-16T21:41:36","modified_gmt":"2014-12-16T21:41:36","slug":"twitter-reaper","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/twitter-reaper\/","author":13615120,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0","stable_tag":"trunk","tested":"3.4.2","requires":"3.0.1","requires_php":"","requires_plugins":"","header_name":"Twitter Reaper","header_author":"Kyle Shike","header_description":"","assets_banners_color":"","last_updated":"2014-12-16 21:41:36","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":566,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[5889,159,20950],"plugin_category":[56],"plugin_contributors":[97449],"plugin_business_model":[],"class_list":["post-33390","plugin","type-plugin","status-closed","hentry","plugin_tags-theme-development","plugin_tags-twitter","plugin_tags-wp_cron","plugin_category-social-and-sharing","plugin_contributors-_qrrr","plugin_committers-_qrrr"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/twitter-reaper.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Set up wp_cron jobs to occur every minute, half-hour, hour, daily, or weekly.  Saves tweet data to database for use in custom theme development.<\/p>\n\n<p>Parses tweet bodies, replacing urls, hashtags and usernames with corresponding hrefs.  Replaces unicode emojis with image sprites.<\/p>\n\n<pre><code>twitter_reaper_get_harvest()\n<\/code><\/pre>\n\n<p>* returns array of tweet data for every tweet saved in the cron\n  * id [the unique ID of the tweet in the Wordpress database]\n  * tweet_id [the unique ID of the image as supplied by Twitter]\n  * tweet\n  * date_created [the date the tweet was made on Twitter]<\/p>\n\n<p>example:<\/p>\n\n<pre><code>$tweets = twitter_reaper_get_harvest();\nforeach ($tweets as $tweets) {\n  &lt;div class=\"single-tweet\"&gt;\n    &lt;p&gt;&lt;?php echo twitter_reaper_tweet_time($tweet['date_created']) . ' ' . twitter_reaper_tweet_date($tweet['date_created']); ?&gt;&lt;\/p&gt;\n     &lt;?php echo $tweet['tweet']; ?&gt;\n  &lt;\/div&gt;\n&lt;?php }\n\n\ntwitter_reaper_get_harvest_in_range($start, $stop)\n<\/code><\/pre>\n\n<p>* returns array of image data for images in range supplied as arguments\n* data return is the same as get_instagram_reap()\n* handy for pagination<\/p>\n\n<p>example:<\/p>\n\n<pre><code>$images = twitter_reaper_get_harvest_in_range(0, 25);\nforeach ($images as $image) { ?&gt;\n  &lt;div class=\"single-tweet\"&gt;\n    &lt;p&gt;&lt;?php echo twitter_reaper_tweet_time($tweet['date_created']) . ' ' . twitter_reaper_tweet_date($tweet['date_created']); ?&gt;&lt;\/p&gt;\n     &lt;?php echo $tweet['tweet']; ?&gt;\n  &lt;\/div&gt;\n&lt;?php }\n\n\ntwitter_reaper_save_tweets()\n<\/code><\/pre>\n\n<p>* this is the function called in the cron-job.  You can call it at your leasure if you want to update get new images outside of the schedule<\/p>\n\n<pre><code>twitter_reaper_get_tweets($args)\n<\/code><\/pre>\n\n<p>* query the Twitter API directly. This will not save in the database\n* currently can query by Hashtag or Username<\/p>\n\n<pre><code>$args:\n<\/code><\/pre>\n\n<p>* query (required) - 'hashtag' or 'username'\n* username - this will get the user ID by the username before querying\n* hashtag - the hashtag for the query\n* count - the number of images to return<\/p>\n\n<p>example:<\/p>\n\n<pre><code>$args = array(\n  'query' =&gt; 'username',\n  'username' =&gt; 'dvl',\n  'count' =&gt; '30'\n);\n\n$tweets = twitter_reaper_get_tweets($args);\nforeach ($tweets as $tweet) { ?&gt;\n  &lt;div class=\"single-tweet\"&gt;\n    &lt;p&gt;&lt;?php echo twitter_reaper_tweet_time($tweet['date_created']) . ' ' . twitter_reaper_tweet_date($tweet['date_created']); ?&gt;&lt;\/p&gt;\n     &lt;?php echo $tweet['tweet']; ?&gt;\n  &lt;\/div&gt;\n&lt;?php }\n<\/code><\/pre>\n\n<h3>Code Snippets<\/h3>\n\n<pre><code>twitter_reaper_get_harvest()\n<\/code><\/pre>\n\n<p>* returns array of tweet data for every tweet saved in the cron\n  * id [the unique ID of the tweet in the Wordpress database]\n  * tweet_id [the unique ID of the image as supplied by Twitter]\n  * tweet\n  * date_created [the date the tweet was made on Twitter]<\/p>\n\n<p>example:<\/p>\n\n<pre><code>$tweets = twitter_reaper_get_harvest();\nforeach ($tweets as $tweets) {\n  &lt;div class=\"single-tweet\"&gt;\n    &lt;p&gt;&lt;?php echo twitter_reaper_tweet_time($tweet['date_created']) . ' ' . twitter_reaper_tweet_date($tweet['date_created']); ?&gt;&lt;\/p&gt;\n     &lt;?php echo $tweet['tweet']; ?&gt;\n  &lt;\/div&gt;\n&lt;?php }\n\n\ntwitter_reaper_get_harvest_in_range($start, $stop)\n<\/code><\/pre>\n\n<p>* returns array of image data for images in range supplied as arguments\n* data return is the same as get_instagram_reap()\n* handy for pagination<\/p>\n\n<p>example:<\/p>\n\n<pre><code>$images = twitter_reaper_get_harvest_in_range(0, 25);\nforeach ($images as $image) { ?&gt;\n  &lt;div class=\"single-tweet\"&gt;\n    &lt;p&gt;&lt;?php echo twitter_reaper_tweet_time($tweet['date_created']) . ' ' . twitter_reaper_tweet_date($tweet['date_created']); ?&gt;&lt;\/p&gt;\n     &lt;?php echo $tweet['tweet']; ?&gt;\n  &lt;\/div&gt;\n&lt;?php }\n\n\ntwitter_reaper_save_tweets()\n<\/code><\/pre>\n\n<p>* this is the function called in the cron-job.  You can call it at your leasure if you want to update get new images outside of the schedule<\/p>\n\n<pre><code>twitter_reaper_get_tweets($args)\n<\/code><\/pre>\n\n<p>* query the Twitter API directly. This will not save in the database\n* currently can query by Hashtag or Username<\/p>\n\n<pre><code>$args:\n<\/code><\/pre>\n\n<p>* query (required) ['hashtag' or 'username']\n* username [this will get the user ID by the username before querying]\n* hashtag [the hashtag for the query]\n* count [the number of images to return]<\/p>\n\n<p>example:<\/p>\n\n<pre><code>$args = array(\n  'query' =&gt; 'username',\n  'username' =&gt; 'dvl',\n  'count' =&gt; '30'\n);\n\n$tweets = twitter_reaper_get_tweets($args);\nforeach ($tweets as $tweet) { ?&gt;\n  &lt;div class=\"single-tweet\"&gt;\n    &lt;p&gt;&lt;?php echo twitter_reaper_tweet_time($tweet['date_created']) . ' ' . twitter_reaper_tweet_date($tweet['date_created']); ?&gt;&lt;\/p&gt;\n     &lt;?php echo $tweet['tweet']; ?&gt;\n  &lt;\/div&gt;\n&lt;?php }\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Upload this plugin to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Provide Twitter API tokens and query options, and start the cron<\/li>\n<\/ol>","raw_excerpt":"A plugin for developers. Gets tweets by username or hashtag","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/33390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=33390"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/_qrrr"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=33390"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=33390"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=33390"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=33390"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=33390"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=33390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}