Is there any plugin available for joomla 2.5 to embed code from github repository. For word press there is a plugin to achieve the same (http://wordpress.org/extend/plugins/github-code-viewer-2/). I wanted to do include code from my github repository into my joomla/k2 articles using something like
{github url='https://github.com/jamescarr/spring-integration/blob/master/spring-integration-file/src/main/java/org/springframework/integration/file/filters/AbstractFileListFilter.java'}
By looking at the wp plugin I thought of writing my own joomla plugin but WP plugin is using *wp_remote_fopen* function and i did not find the same kind of function in joomla and read some articles about vulnerabilities using such remote_open functions. Here is what WP plugin is doing
function getGitHubFile($url, $ttl = null){
self::__loadCache($url, $ttl);
if (isset(self::$cache[$url])) {
$code = self::$cache[$url];
} else {
$code = wp_remote_fopen($url . '?raw=true');
if ($code == '') {
return 'You need cURL installed to use GitHub_Code_Viewer';
}
$code = str_replace('<', '<', $code);
self::__setCache($url, $code);
}
return $code;
}