Created
October 21, 2011 06:33
-
-
Save zudochkin/1303241 to your computer and use it in GitHub Desktop.
Fucking-great-advice.ru (php)
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
#!/usr/bin/php | |
<?php | |
/** | |
* @url http://vredniy.ru | |
* @author Dmitry Zudochkin <[email protected]> | |
**/ | |
$obj = json_decode(file_get_contents('http://fucking-great-advice.ru/api/random')); | |
$obj->text = html_entity_decode(str_replace(' ', ' ', preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $obj->text))); | |
echo $obj->text, "\n"; |
пока только руби, не хочу скакать, но совет твой занесу в избранное ) спасибо
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
На рельсах? Пройди "Rails for zombies", прикольный курс :)