Skip to content

Instantly share code, notes, and snippets.

@daipresents
Last active May 16, 2016 05:45
Show Gist options
  • Select an option

  • Save daipresents/83f48620b719c515cd340e4f9c2c40d8 to your computer and use it in GitHub Desktop.

Select an option

Save daipresents/83f48620b719c515cd340e4f9c2c40d8 to your computer and use it in GitHub Desktop.
Pukiwikiでソースコードをハイライトするプラグインを作ろうかと
define(HIGHLIGHT_DIR, SKIN_DIR . 'dp.SyntaxHighlighter/Scripts/');
define('PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK', 0);
#highlight(php){{
<?php
include('xml.php');
$RSS_HOST = 'http://daipresents.com/rss.xml';
$xml_data = file_get_contents($RSS_HOST);
//$xml = mb_convert_encoding(file_get_contents($RSS_HOST), 'UTF-8′, 'auto');
$data = XML_unserialize($xml_data);
echo "<ul>";
foreach($data['rss']['channel']['item'] as $entry){
echo '<li><a href="' . $entry['link'] . '">' . $entry['title'] . '</a>(' . $entry['pubDate'] . ')</li>';
}
?>
}}
#highlight(end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment