# Variables that accept Templum syntax may use the following variables: # $action, $CONFIG_DIR, $device, $ga_enabled, $highlight (minibar only), # $minibar, $mobile, $name, $narrow, $openid_enabled, $orientation (minibar # only), $portal, $request_uri, $small, $theme, $url_scheme, $url_root # $portal is the values in this file after processing. # Name of your portal name: Scott Zeid (scottywz) # Preferred URL for your portal (used in the top banner); # defaults to script path / $PHP_SELF url: https://more.s.zeid.me/ # Root URL to use in absolute URLs (you should only need to change this if # the automatic detection does not work). $CONFIG_DIR should be in here. # url-root: http://bnay.example/ # Default theme name (see the "themes" key) theme: new # Whether the listing should be narrow narrow: False # Whether the list images and text should be small small: False # Default minibar orientation (horizontal or vertical) minibar-orientation: horizontal # The top banner banner: # Either "text" or "image" type: text # Text to display if type is text; image URL if type is image # Templum syntax is accepted here. Defaults to the portal's name when type is # text. content: '{{$name}}' # Sites you want to link to # Format: # machine-readable-name--only-letters-numbers-underscores-and-hyphens: # name: Name you want visitors to see # icon: Icon filename under $CONFIG_DIR/icons & $CONFIG_DIR/icons/small # url: URL of the site # desc: Optional text description # index: Set to False to hide in the main list; leave out otherwise # minibar: Set to False to hide in the minibar list; leave out otherwise sites: portal: name: more.s.zeid.me icon: portal.png url: https://more.s.zeid.me/ desc: List of my Web presences index: False s.zeid.me: name: s.zeid.me icon: scottywz.png url: https://s.zeid.me/ desc: Main Web site and blog green-midget-cafe: name: Green Midget Café icon: greenmidgetcafe.png url: https://www.greenmidgetcafe.com/ desc: A tribute to Monty Python's "SPAM" sketch amirunninglinux: name: Am I Running Linux? icon: tux.png url: https://amirunninglinux.com/ desc: See if you're running Linux, the world's best operating system. code: name: Code icon: gitlab.png url: https://code.s.zeid.me/ desc: Have a look at my code! userstyles: name: User Styles icon: userstyles.png url: https://userstyles.org/users/338 desc: My profile on userstyles.org gist: name: GitHub Gists icon: github.png url: https://gist.github.com/scottywz desc: X11 License (https://tldrlegal.com/l/x11) unless secret or otherwise noted photos: name: Photos icon: photos.png url: https://photos.s.zeid.me/ desc: My photos. Most are released under a Creative Commons license. last.fm: name: | Last.fm [[//require_once("$CONFIG_DIR/lib/spyc.php"); $cache = "$CONFIG_DIR/last-fm_cache.txt"; if (!file_exists($cache) || time()>=filemtime($cache)+30) { // load config $config = spyc_load(file_get_contents("$CONFIG_DIR/last-fm_config.yml")); $user = (isset($config["user"])) ? $config["user"] : ""; $key_path = (isset($config["key-path"])) ? $config["key-path"] : ""; if (substr($key_path, 0, 2) === "~/" || substr($key_path, 0, 2) === "~\\") { // expand home directory if (strtolower(substr(php_uname("s"), 0, 3)) !== "win") $home = getenv("HOME"); else $home = getenv("USERPROFILE"); $key_path = $home.DIRECTORY_SEPARATOR.substr($key_path, 2); } $key = (is_file($key_path)) ? trim(file_get_contents($key_path)) : ""; $replace = []; if (isset($config["replace"]) && is_array($config["replace"])) $replace = $config["replace"]; // get and save song info $have_song = false; $title = $artist = $album = $now_playing = null; if (!empty($key)) { // use authenticated API $json = file_get_contents("http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$key&format=json&limit=1"); $json = json_decode($json, true); if (isset($json["recenttracks"]["track"][0]) && is_array($json["recenttracks"]["track"][0])) { $track = $json["recenttracks"]["track"][0]; $title = (isset($track["name"])) ? $track["name"] : ""; $artist = (isset($track["artist"]["#text"])) ? $track["artist"]["#text"] : ""; $album = (isset($track["album"]["#text"])) ? $track["album"]["#text"] : ""; $now_playing = (isset($track["@attr"]["nowplaying"])) ? $track["@attr"]["nowplaying"] : false; $have_song = true; } } else { // use RSS feed require_once("$CONFIG_DIR/SimplePie.compiled.php"); $feed = new SimplePie(); $feed->set_feed_url("http://ws.audioscrobbler.com/1.0/user/$user/recenttracks.rss"); $feed->enable_cache(false); $feed->init(); $items = $feed->get_items(); if (count($items)) { $song = $items[0]->get_title(); $song_array = explode(" – "/*"fucking Vim...*/, $song, 2); if (count($song_array) === 2) { $title = $song_array[1]; $artist = $song_array[0]; $now_playing = time() + 5 <= $items[0]->get_date("U") + 10; $have_song = true; } } } foreach (["title", "artist"] as $var) { foreach ($replace as $s => $r) $$var = str_replace($s, $r, $$var); } if ($have_song) { $prefix = ($now_playing) ? "Now playing" : "Last song played"; $song = "$prefix: “{$title}” by {$artist}"; file_put_contents($cache, $song); } } // Yeah, that's right! Last.fm status on my homepage! // Fsck yeah! ]] icon: | [[$cache = "$CONFIG_DIR/last-fm_cache.txt"; $song = explode(": "/*"*/, file_get_contents($cache), 2); $playing = ($song[0] == "Now playing") ? true : false; echo ($playing) ? "last-fm.png" : "last-fm-grayscale.png"; ]] url: http://www.last.fm/user/ScottyWZ desc: | [[$cache = "$CONFIG_DIR/last-fm_cache.txt"; $song = file_get_contents($cache); echo htmlentities($song, ENT_QUOTES, "UTF-8", false); ]] wikipedia: name: User:ScottyWZ icon: wikipedia.png url: https://en.wikipedia.org/wiki/User:ScottyWZ desc: My user page on the English Wikipedia quotes: name: Quote collection icon: quotes.png url: https://quotes.s.zeid.me/ #desktoply: # name: Desktoply # icon: desktop.png # url: http://desktop.ly/scottywz # desc: What my desktops look like amhrian: name: Song Lyrics icon: amhrian.png url: https://amhrian.bnay.me/ desc: A collection of song lyrics (mostly of Irish songs) in both XHTML and YAML list: name: | {{(stripos($_SERVER["HTTP_HOST"], "s.zeid.me") !== false) ? "Subdomains" : "Directory listing"}} icon: list.png url: | {{(stripos($_SERVER["HTTP_HOST"], "s.zeid.me") !== false) ? "https://s.zeid.me/_/" : "/?index"}} desc: | {{(stripos($_SERVER["HTTP_HOST"], "s.zeid.me") !== false) ? "of s.zeid.me" : "List of files on this domain"}} minibar: False #source: # name: source.php # icon: sourcephp.png # url: /source/php # desc: PHP source code of this site # Extra content to put in the footer. This can be disclaimers, contact info, # or anything else you see fit. Templum syntax is accepted here. custom-footer-content: |
Hosted on a prgmr.com VPS running {{exec('. /etc/os-release; echo $NAME')}}.
# Extra content to put in the HTML head element. Templum syntax is # accepted here. custom-head-content: | [[if (!$minibar) {]][[}]] # Whether to show W3C Validator links # Set to False if you don't want to show them, or if you know that your portal # will not validate and you don't want to fix it (although you should) show-validator-links: True # Optional value for the link target attribute; defaults to nothing # Example: _blank link-target: # Optional Google Analytics credentials google-analytics: # Account number account: # Set to "old" if you want to use the old style code; new is recommended. style: new # Optional OpenID header tag stuff # # You would get these URLs from your OpenID provider's help pages; look for a # section that says something like "Use your own URL" and gives you some HTML # code. Then take the URLs from that code and paste them into the respective # keys here. # # You can omit either provider and local_id or server and delegate if your # provider does not give you those URLs. However, server and provider are # often the same, as are delegate and local_id. openid: # OpenID server URL server: http://www.myopenid.com/server # OpenID provider URL provider: http://www.myopenid.com/server # Delegate URL delegate: http://scottywz.myopenid.com/ # Local ID URL local_id: http://scottywz.myopenid.com # XRDS URL xrds: http://www.myopenid.com/xrds?username=scottywz.myopenid.com # Themes # Templum syntax is accepted here. # # You can also set an optional "custom_css" key for each theme, which, as # its name suggests, lets you add custom CSS to that theme. The CSS will # be added to the end of the original stylesheet. Templum is accepted in # custom CSS, and you also have access to a $theme array, which contains # all of the other settings for the theme. themes: new: bg: '#F8F8F8' fg: ['#222', '#222', '#FFF', '#FFF'] logo_bg: '#F8F8F8' logo_border: '#F8F8F8' ico_bg: '#F8F8F8' link_bg: '#F8F8F8' link_bg_h: '#903' link_bg_a: '#803' custom_css: | #action_minibar { background: transparent; text-align: right; } #action_minibar a.highlight { background: #800; color: #FFF; } #footer a { color: #A00; } #footer a[href="http://bnay.me/#sound"] { color: #222 !important; } new-green: bg: '#E0E0E0' fg: ['#222', '#222', '#FFF', '#FFF'] logo_bg: '#E0E0E0' logo_border: '#E0E0E0' ico_bg: '#E0E0E0' link_bg: '#E0E0E0' link_bg_h: '#060' link_bg_a: '#040' custom_css: | #action_minibar { background: transparent; text-align: right; } #action_minibar a.highlight { background: #060; color: #FFF; } #footer a { color: #060; } #footer a[href="http://bnay.me/#sound"] { color: #222 !important; } wp-2011-red: bg: '#F1F1F1' fg: ['#FFF', '#EEE', '#DDD', '#CCC'] logo_bg: '#700' logo_border: '#300' #fg: ['#111', '#222', '#333', '#444'] #logo_bg: '#FFF' #logo_border: '#BBB' ico_bg: '#FFF' link_bg: '#800' link_bg_h: '#700' link_bg_a: '#600' red: bg: '#636363 url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAACWCAMAAAAoqBJAAAACEFBMVEVKSkpKSktKS0pKS0tLSkpLSktLS0pLS0tLS0xLTEtLTExMS0tMS0xMTEtMTExMTE1MTUxMTU1NTExNTE1NTUxNTU1NTU5NTk1NTk5OTU1OTU5OTk1OTk5OTk9OT05OT09PTk5PTk9PT05PT09PT1BPUE9PUFBQT09QT1BQUE9QUFBQUFFQUVBQUVFRUFBRUFFRUVBRUVFRUVJRUlFRUlJSUVFSUVJSUlFSUlJSUlNSU1JSU1NTUlJTUlNTU1JTU1NTU1RTVFNTVFRUU1NUU1RUVFNUVFRUVFVUVVRUVVVVVFRVVFVVVVRVVVVVVVZVVlVVVlZWVVVWVVZWVlVWVlZWVldWV1ZWV1dXVlZXVldXV1ZXV1dXV1hXWFdXWFhYV1dYV1hYWFdYWFhYWFlYWVhYWVlZWFhZWFlZWVhZWVlZWVpZWllZWlpaWVlaWVpaWllaWlpaWltaW1paW1tbWlpbWltbW1pbW1tbW1xbXFtbXFxcW1tcW1xcXFtcXFxcXF1cXVxcXV1dXFxdXF1dXVxdXV1dXV5dXl1dXl5eXV1eXV5eXl1eXl5eXl9eX15eX19fXl5fXl9fX15fX19fX2BfYF9fYGBgX19gX2BgYF9gYGBgYGFgYWBgYWFhYGBhYGFhYWBhYWFhYWJhYmFhYmJiYWFiYWJiYmFiYmJiYmNiY2JiY2NjYmJjYmNjY2JjY2N4wovhAAAAW0lEQVQY07XNyRGDQBQDUf03W/7p2pjxAYoMKF27W0kGTnQ/DFvTRXRNoTSxfJQhGEpD3dSJ6dAwfU0xbZR9OxfXdByPtWz97lxfdFEipoglOk9vCU5TPT95f39fWxLYueOzkQAAAABJRU5ErkJggg==") repeat-x fixed' fg: ['#FFF', '#EEE', '#DDD', '#CCC'] logo_bg: '#700' logo_border: '#300' ico_bg: '#FFF' link_bg: '#903' link_bg_h: '#803' link_bg_a: '#703' red-dark-bg: bg: '#444' fg: ['#FFF', '#EEE', '#DDD', '#CCC'] logo_bg: '#600' logo_border: '#300' ico_bg: '#FFF' link_bg: '#700' link_bg_h: '#600' link_bg_a: '#500' brown-red: bg: '#441A00' fg: ['#FFF', '#EEE', '#DDD', '#CCC'] logo_bg: '#700' logo_border: '#300' ico_bg: '#500' link_bg: '#900' link_bg_h: '#800' link_bg_a: '#700' red-green: bg: '#040' fg: ['#FFF', '#EEE', '#DDD', '#CCC'] logo_bg: '#700' logo_border: '#300' ico_bg: '#500' link_bg: '#900' link_bg_h: '#800' link_bg_a: '#700' win-classic: bg: '#3A6EA5' fg: ['#FFF', '#EEE', '#DDD', '#CCC'] logo_bg: transparent logo_border: '#FFF' ico_bg: '#3A6EA5' link_bg: '#0A246A' # Alternate: A6CAF0 link_bg_h: '#0A246A' link_bg_a: '#0A246A'