Skip to content

Instantly share code, notes, and snippets.

@zudochkin
Created October 21, 2011 06:33
Show Gist options
  • Save zudochkin/1303241 to your computer and use it in GitHub Desktop.
Save zudochkin/1303241 to your computer and use it in GitHub Desktop.
Fucking-great-advice.ru (php)
#!/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('&nbsp;', ' ', preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $obj->text)));
echo $obj->text, "\n";
@gailimov
Copy link

На рельсах? Пройди "Rails for zombies", прикольный курс :)

@zudochkin
Copy link
Author

пока только руби, не хочу скакать, но совет твой занесу в избранное ) спасибо

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment