Created
November 13, 2013 08:02
-
-
Save frdmn/7445386 to your computer and use it in GitHub Desktop.
Subreddit HTML export/lister
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php | |
# Subreddit HTML export | |
# | |
# Log into Reddit and browse to "http://www.reddit.com/reddits.json" | |
# Save the content with the filename "reddits.json" and place it besides | |
# this file in the same directory. | |
$json = file_get_contents("./reddits.json"); | |
$json = json_decode($json, true); | |
foreach ($json["data"]["children"] as $child) { | |
echo "<li><a href='http://reddit.com".$child['data']['url']."'>".$child['data']['url']."</a></li>"; | |
} | |
?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment