├── README.md └── pocket-to-wordpress.php /README.md: -------------------------------------------------------------------------------- 1 | # Pocket to Wordpress 2 | Working on a new WordPress plugin that will help you display your Pocket info on your WordPress site. WHen it's ready, I'll upload to the WordPress repository. 3 | 4 | This adventure into the Pocket API was inspired because I wanted to get all of my Pocket items that were tagged "reading" and display them as a reading list on my WordPress site. 5 | 6 | Kudos to [Rob Neu (@rob_neu)](https://twitter.com/rob_neu) for some helpful tweaks. 7 | 8 | You'll need a Pocket consumer key and access token in order to use their API. Visit https://getpocket.com/developer/ to register an app and get a key. 9 | 10 | You can then use https://github.com/jshawl/pocket-oauth-php to get your access token. 11 | 12 | If you don't mind trusting some random site, you can use http://reader.fxneumann.de/plugins/oneclickpocket/auth.php to get your access token a lot quicker. 13 | 14 | Then use the shortcode [pocket_items] or the function get_pocket_items_html() to display your pocket items. 15 | 16 | You can also use get_pocket_items() to retrieve the item data and display as you like. 17 | -------------------------------------------------------------------------------- /pocket-to-wordpress.php: -------------------------------------------------------------------------------- 1 | null, 77 | 'token' => null, 78 | 'tag' => NULL, 79 | 'store_items' => '7200' // Will cache the item for 2 hours by default. Set to false for no cache. 80 | ); 81 | extract( wp_parse_args( $args, $defaults ), EXTR_OVERWRITE ); 82 | 83 | // Build html 84 | $pocket_html = NULL; 85 | 86 | // Get the items 87 | $pocket_items = get_pocket_items( shortcode_atts( $defaults, $args ) ); 88 | 89 | // If we have no items 90 | if ( ! ( isset( $pocket_items ) && is_array( $pocket_items ) ) ) 91 | return NULL; 92 | 93 | // Start building the HTML 94 | $pocket_html .= '