{"id":17767074,"url":"https://github.com/oliverfindl/wp-import-reddit","last_synced_at":"2026-05-19T02:04:21.075Z","repository":{"id":111472131,"uuid":"170017869","full_name":"oliverfindl/wp-import-reddit","owner":"oliverfindl","description":"[POC] Simple cron script for WordPress CMS used for importing embeds of new posts from Reddit.","archived":false,"fork":false,"pushed_at":"2019-04-13T10:12:51.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-07T08:49:03.737Z","etag":null,"topics":["cms","cron","embed","import","pdo","php","php7","reddit","script","sqlite3","subreddit","wordpress","wp-import-reddit"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oliverfindl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-10T19:34:06.000Z","updated_at":"2019-04-13T10:12:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"d53e95b5-91f3-45d4-851c-7a42e4af12d3","html_url":"https://github.com/oliverfindl/wp-import-reddit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fwp-import-reddit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fwp-import-reddit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fwp-import-reddit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverfindl%2Fwp-import-reddit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverfindl","download_url":"https://codeload.github.com/oliverfindl/wp-import-reddit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246651559,"owners_count":20811994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","cron","embed","import","pdo","php","php7","reddit","script","sqlite3","subreddit","wordpress","wp-import-reddit"],"created_at":"2024-10-26T20:42:30.444Z","updated_at":"2026-05-19T02:04:21.027Z","avatar_url":"https://github.com/oliverfindl.png","language":"PHP","funding_links":["https://paypal.me/oliverfindl"],"categories":[],"sub_categories":[],"readme":"# wp-import-reddit\n\n![license](https://img.shields.io/github/license/oliverfindl/wp-import-reddit.svg?style=flat)\n[![paypal](https://img.shields.io/badge/donate-paypal-blue.svg?colorB=0070ba\u0026style=flat)](https://paypal.me/oliverfindl)\n\nSimple cron script for [WordPress][WP] CMS used for importing embeds of new posts from [Reddit][R].\n\n\u003e This script is proof of concept. Never was used in production.\n\n---\n\n## Usage\n\nIf you completed the [installation](#install) and [setup](#setup) process, you have cron set up and running. Every period of time set in crontab, you should get new posts on your blog if there were any on reddit.\n\n## Requirements\n\n* [PHP 7][PHP-7]\n* [PHP PDO extension][PHP-PDO-EXT]\n* [WordPress][WP]\n\n## Install\n\n```bash\n# change directory to wp root\n$ cd /path/to/your/wp-root\n\n# create cron directory if not exists\n$ mkdir cron\n\n# change directory to wp cron root\n$ cd cron\n\n# clone this repo\n$ git clone https://github.com/oliverfindl/wp-import-reddit.git wp-import-reddit-temp\n\n# copy wp-import-reddit files from repo to wp cron root\n$ cp wp-import-reddit-temp/src/wp-import-reddit.php .\n\n# delete repo\n$ rm -r wp-import-reddit-temp\n\n# add reddits embed dependency library into functions.php file\n$ vim ../wp-content/themes/\u003cTHEME-NAME\u003e/functions.php\n```\n\n```php\n// reddits embed dependency library\nwp_enqueue_script(\"reddit-embed\", \"https://embed.redditmedia.com/widgets/platform.js\", array(), null, false);\n```\n\n## Setup\n\n```bash\n# set preferred options in wp-import-reddit.php file\n$ vim wp-import-reddit.php\n```\n\n## Options\n\n```php\ndefine(\"WP_LOAD_PATH\", dirname(__DIR__) . \"/wp-load.php\"); // path to wp-load.php file\ndefine(\"WP_POST_STATUS\", \"publish\"); // post status, format: publish|draft|pending|private\ndefine(\"WP_AUTHOR_ID\", 1); // author id from wp, format: integer\ndefine(\"WP_CATEGORY_IDS\", [1]); // array of category ids from wp, format: array of integers\n\ndefine(\"DB_FILE_PATH\",  __DIR__ . \"/wp-import-reddit.sqlite3\"); // path to cron sqlite3 database file\n\ndefine(\"SINCE_TIME\", strtotime(\"-1 day\")); // posts since time for import, format: timestamp\ndefine(\"UNTIL_TIME\", strtotime(\"-1 hour\")); // posts until time for import, format: timestamp\n\ndefine(\"REGEXP_URL\", \"/^https?:\\/\\/(?:www\\.)?(i\\.redd\\.it|(?:i\\.)?imgur\\.com|(?:media\\.)?giphy\\.com|gph\\.is|gfycat\\.com|youtu(?:be\\.com|\\.be))\\//\"); // regular expression for filtering posts based on url of original media, format: false|regexp\n```\n\n```bash\n# run script manually\n/path/to/your/wp-root/cron/wp-import-reddit.php anime manga japan\n\n# add script to crontab\n$ crontab -e\n\n0 0 * * * /path/to/your/wp-root/cron/wp-import-reddit.php anime manga japan\n```\n\n## Uninstall\n\n```bash\n# change directory to wp root\n$ cd /path/to/your/wp-root\n\n# remove reddits embed dependency library from functions.php file\n$ vim wp-content/themes/\u003cTHEME-NAME\u003e/functions.php\n\n# change directory to wp cron root\n$ cd cron\n\n# remove wp-import-reddit files\n$ rm wp-import-reddit.{php,sqlite3}\n\n# remove cron directory if its empty\n$ rm -r cron\n\n# remove script from crontab\n$ crontab -e\n```\n\n---\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\n[WP]: https://wordpress.org/\n[R]: https://www.reddit.com/\n[PHP-7]: https://secure.php.net/manual/en/install.php\n[PHP-PDO-EXT]: https://secure.php.net/manual/en/book.memcached.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverfindl%2Fwp-import-reddit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverfindl%2Fwp-import-reddit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverfindl%2Fwp-import-reddit/lists"}