Difference between revisions of "Template:Mainpage-rssfeeds"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m
(Usage:)
Line 30: Line 30:
 
</nowiki>
 
</nowiki>
  
* charset=...             The charset used by the feed. iconv is used to convert this.
+
{|
* short                   Do not show the description text for each news item.
+
|-
* max=x                   Shows x most recent headlines.
+
||charset=...   ||        The charset used by the feed. iconv is used to convert this.
* highlight= term1 term2 The terms separated by a space are highlighted.
+
|-
* filter= term1 term2    Show only rss items containing at least one of the terms.
+
|| short         ||          Do not show the description text for each news item.
* reverse                display the rss items in reverse order.
+
|-
* title=x                display an alternative title instead of chanel name.
+
|| max=x         ||        Shows x most recent headlines.
* title = none            dont display any title.
+
|-
 +
|| highlight= term1 term2 || The terms separated by a space are highlighted.
 +
|-
 +
|| filter= term1 term2    ||Show only rss items containing at least one of the terms.
 +
|-
 +
|| reverse                ||display the rss items in reverse order.
 +
|-
 +
|| title=x                ||display an alternative title instead of chanel name.
 +
|-
 +
|| title = none            ||dont display any title.
 +
|}
  
 
===Example:===  
 
===Example:===  

Revision as of 16:27, 29 July 2006

UNIQ321c17217fc278dc-rss-00000000-QINU UNIQ321c17217fc278dc-rss-00000001-QINU

GISWiki/RSS

Uses an extension from: http://meta.wikimedia.org/wiki/GISWiki/RSS

RSS-Feed Mediawiki extension

  • original by mutante 25.03.2005
  • extended by Duesentrieb 30.04.2005
  • extended by Rdb78 07.07.2005
  • extended by Mafs 10.07.2005, 24.07.2005
  • extended by User:Arcy 07.09.2005
  • Updated for MediaWiki 1.6 by User:piku 13.06.2006
  • Update for Wikicode output, by User:cogdog 14.jul.2006

Requires:

Installation:

  • put this file (rss.php) into the extension directory of your mediawiki installation
  • add the following to the end of LocalSettings.php: include("extensions/rss.php");
  • make sure magpie can be found by PHP.

Usage:

Use one section between <rss>-tags for each feed. The rss section may contain parameters separated by a pipe ("|"), just like links and templates. These parameters are supported:

charset=... The charset used by the feed. iconv is used to convert this.
short Do not show the description text for each news item.
max=x Shows x most recent headlines.
highlight= term1 term2 The terms separated by a space are highlighted.
filter= term1 term2 Show only rss items containing at least one of the terms.
reverse display the rss items in reverse order.
title=x display an alternative title instead of chanel name.
title = none dont display any title.

Example:

<rss>http://slashdot.org/slashdot.rss|charset=UTF-8|short|max=5</rss>

Galileo Satellites Are Experiencing Multiple Clock Failures

Fri, 20 Jan 2017 07:00:00

elgatozorbas writes: According to a BBC article, the onboard atomic clocks that drive the satellite-navigation signals on Europe's Galileo network have been failing at an alarming rate. From the report: "Across the 18 satellites now in orbit, nine clocks have stopped operating. Three are traditional rubidium devices; six are the more precise hydrogen maser instruments that were designed to give Galileo superior performance to the American GPS network. Each Galileo satellite carries two rubidium and two hydrogen maser clocks. The multiple installation enables a satellite to keep working after an initial failure. All 18 spacecraft currently in space continue to operate, but one of them is now down to just two clocks. Most of the maser failures (5) have occurred on the satellites that were originally sent into orbit to validate the system, whereas all three rubidium stoppages are on the spacecraft that were subsequently launched to fill out the network. Esa staff at its technical centre, ESTEC, in the Netherlands are trying to isolate the cause the of failures - with the assistance of the clock (Spectratime of Switzerland) and satellite manufacturers (Airbus and Thales Alenia Space; OHB and SSTL). It is understood engineers have managed to restart another hydrogen clock that had stopped. It appears the rubidium failures 'all seem to have a consistent signature, linked to probable short circuits, and possibly a particular test procedure performed on the ground.'"

Share on Google+


Read more of this story at Slashdot.

3D TV Is Dead

Fri, 20 Jan 2017 03:30:00

While Samsung dropped 3D support in 2016, LG and Sony -- the last two major TV makers to support the 3D feature in their TVs -- will stop doing so in 2017. None of their TVs, including the high-end OLED TV models, will be able to show 3D movies and TV shows. As a result, 3D TV is dead. The question is no longer when (or even why) 3D TVs will become obsolete, it's will 3D TVs ever rise again? CNET reports: The 3D feature has been offered on select televisions since 2010, when the theatrical success of "Avatar" in 3D helped encourage renewed interest in the technology. In addition to a 3D-capable TV, it requires specialized glasses for each viewer and the 3D version of a TV show or movie -- although some TVs also offer a simulated 3D effect mode. Despite enthusiasm at the box office and years of 3D TVs being available at affordable prices, the technology never really caught on at home. DirecTV canceled its 24/7 3D channel in 2012 and ESPN followed suit a year later. There are plenty of 3D Blu-ray discs still being released, such as "Star Wars: The Force Awakens," but if you want to watch them at home you'll need a TV from 2016 or earlier -- or a home theater projector. Those market trends are clear: Sales of 3D home video gear have declined every year since 2012. According to data from the NPD Group, 3D TV represents just 8 percent of total TV sales dollars for the full year of 2016, down from 16 percent in 2015 and 23 percent in 2012. Native 3D-capable Blu-ray players fell to just 11 percent of the market in 2016, compared to 25 percent in 2015 and 40 percent in 2012. As for whether or not 3D TVs will ever become popular again, David Katzmaier writes via CNET, based on his own "anecdotal experience as a TV reviewer": Over the years, the one thing most people told me about the 3D feature on their televisions was that they never used it. Sure, some people occasionally enjoyed a 3D movie on Blu-ray, but the majority of people I talked to tried it once or twice, maybe, then never picked up the glasses again. I don't think most viewers will miss 3D. I have never awarded points in my reviews for the feature, and 3D performance (which I stopped testing in 2016) has never figured into my ratings. I've had a 3D TV at home since 2011 and I've only used the feature a couple of times, mainly in brief demos to friends and family. Over the 2016 holiday break I offered my family the choice to watch "The Force Awakens" in 2D or 3D, and (after I reminded everyone they had to wear the glasses) 2D was the unanimous choice. But some viewers will be sad to see the feature go. There's even a change.org petition for LG to bring back the feature, which currently stands at 3,981 supporters. Of course 3D TV could come back to life, but I'd be surprised if it happened before TV makers perfect a way to watch it without glasses.

Share on Google+


Read more of this story at Slashdot.

Neuroscience Can't Explain How a Microprocessor Works

Fri, 20 Jan 2017 02:05:00

mspohr writes: The Economist has an interesting story about two neuroscientists/engineers -- Eric Jonas of the University of California, Berkeley, and Konrad Kording of Northwestern University, in Chicago -- who decided to test the methods of neuroscience using a 6502 processor. Their results are published in the PLOS Computational Biology journal. Neuroscientists explore how the brain works by looking at damaged brains and monitoring inputs and outputs to try to infer intermediate processing. They did the same with the 6502 processor which was used in early Atari, Apple and Commodore computers. What they discovered was that these methods were sorely lacking in that they often pointed in the wrong direction and missed important processing steps.

Share on Google+


Read more of this story at Slashdot.

Scottish Government Targets 66% Emissions Cut By 2032

Fri, 20 Jan 2017 01:25:00

An anonymous reader quotes a report from BBC: The Scottish government has outlined a new target of reducing greenhouse gas emissions by 66% by 2032. Climate Change Secretary Roseanna Cunningham set out the government's draft climate change plan for the next 15 years at Holyrood. She also targeted a fully-decarbonized electricity sector and 80% of domestic heat coming from low-carbon sources. Ministers committed last year to cut harmful CO2 emissions by 80% by 2050, with a new interim target of 50% by 2020. The previous interim target of 42% was met in 2014 -- six years early. However, the independent Committee on Climate Change said the decrease was largely down to a warmer than average winter reducing the demand for heating. Ms Cunningham said the new targets demonstrated "a new level of ambition" to build a low-carbon economy and a healthier Scotland. Goals to be achieved by 2032 include: Cutting greenhouse emissions by 66%; A fully-decarbonized electricity sector; 80% of domestic heat to come from low-carbon heat technologies; Proportion of ultra-low emission new cars and vans registered in Scotland annually to hit 40%; 250,000 hectares of degraded peatlands restored; Annual woodland creation target increased to at least 15,000 hectares per year. The 172-page document sets a road map for decarbonizing Scotland. The aim -- although not new -- is to reduce greenhouse gas emissions by two thirds by 2032. Among the policies are making half of Scotland's buses low-carbon, full-decarbonizing the electricity sector and making 80% of homes heated by low-carbon technologies.

Share on Google+


Read more of this story at Slashdot.

Oracle Scraps Plans For Solaris 12

Fri, 20 Jan 2017 00:45:00

bobthesungeek76036 writes: According to The Register, Solaris 12 has been removed from Oracle roadmaps. This pretty much signals the demise of Solaris (as if we didn't already know that...) From the report: "The new blueprint -- dated January 13, 2017 -- omits any word of Solaris 12 that Oracle included in the same document's 2014 edition, instead mentioning 'Solaris 11.next' as due to debut during this year or the next complete with 'Cloud Deployment and Integration Enhancements.' At the time of writing, search engines produce no results for 'Solaris 11.next.' The Register has asked Oracle for more information. The roadmap also mentions a new generation of SPARC silicon in 2017, dubbed SPARC Next, and then in 2020 SPARC Next+. The speeds and capabilities mentioned in the 2017 document improve slightly on those mentioned in the 2014 roadmap.

Share on Google+


Read more of this story at Slashdot.


===rss.php=== 

<?php
# RSS-Feed Mediawiki extension
# 
# original by mutante 25.03.2005
# extended by Duesentrieb 30.04.2005
# extended by Rdb78 07.07.2005
# extended by Mafs  10.07.2005, 24.07.2005
# extended by User:Arcy  07.09.2005
# Updated for MediaWiki 1.6 by User:piku 13.06.2006
# Update for Wikicode output, by User:cogdog 14.jul.2006
#
# Requires: 
#  * magpie rss parser <http://magpierss.sourceforge.net/>
#  * iconv <http://www.gnu.org/software/libiconv/>, see also <http://www.php.net/iconv>
#
# Installation:
#  * put this file (rss.php) into the extension directory of your mediawiki installation 
#  * add the following to the end of LocalSettings.php: include("extensions/rss.php");
#  * make sure magpie can be found by PHP.
#
# Usage:
#  Use one section between <rss>-tags for each feed. The rss section may contain parameters
#  separated by a pipe ("|"), just like links and templates. These parameters are supported:
#
#    * charset=...             The charset used by the feed. iconv is used to convert this.
#    * short                   Do not show the description text for each news item.
#    * max=x                   Shows x most recent headlines.
#    * highlight= term1 term2  The terms separated by a space are highlighted.
#    * filter= term1 term2     Show only rss items containing at least one of the terms.
#    * reverse                 display the rss items in reverse order.
#    * title=x                 display an alternative title instead of chanel name.
#    * title = none            dont display any title.
#
# Example: 
#    <rss>http://slashdot.org/slashdot.rss|charset=UTF-8|short|max=5</rss>
#

#change this according to your magpie installation!
require_once('rss_fetch.inc'); 

#install extension hook
$wgExtensionFunctions[] = "wfRssExtension"; 

#extension hook callback function
function wfRssExtension() { 
  global $wgParser;

  #install parser hook for <rss> tags
  $wgParser->setHook( "rss", "renderRss" );
}

#parser hook callback function
function renderRss($input, $argv, $parser = null) {
  if (!$parser) $parser =& $GLOBALS['wgParser'];
  global $wgOutputEncoding;

  $DefaultEncoding = "ISO-8859-1";
  $DisableCache = true;

  # $input = mysql_escape_string($input);

  if (!$input) return ""; #if <rss>-section is empty, return nothing

  #parse fields in rss-section
  $fields= explode("|",$input);
  $url= @$fields[0];

  $args= array();
  for ($i=1; $i<sizeof($fields); $i++) {
    $f= $fields[$i];

    if (strpos($f,"=")===False) $args[strtolower(trim($f))]= False;
    else {
      list($k,$v)= explode("=",$f,2);
      if (trim($v)==False) $args[strtolower(trim($k))] = False; 
      else $args[strtolower(trim($k))]= trim($v);
    }
  }

  #get charset from argument-array    
  $charset= @$args["charset"];
  if (!$charset) $charset= $DefaultEncoding;

  #get max number of headlines from argument-array
  $maxheads = @$args["max"];
  $headcnt = 0;

  #get short-flag from argument-array
  #if short is set, no description text is printed
  if (isset($args["short"])) $short = True; else $short = False;

  #get reverse-flag from argument-array
  if (isset($args["reverse"])) $reverse = True; else $reverse = False;

  #get highlight terms from argument-array    
  $rssHighlight= @$args["highlight"];
  $rssHighlight= str_replace("  "," ", $rssHighlight);
  $rssHighlight= explode(" ", trim($rssHighlight));

  #get filter terms from argument-array    
  $rssFilter= @$args["filter"];
  $rssFilter= str_replace("  "," ", $rssFilter);
  $rssFilter= explode(" ", trim($rssFilter));    

  #fetch rss. may be cached locally.
  #Refer to the documentation of magpie for details.
  $rss = @fetch_rss($url);


  #check for errors.
  if ($rss->ERROR) {
     # return "Feed error"; #localize...
      #return "<div>Failed to load RSS feed from $url: ".$rss->ERROR."</div>"; #localize...
  }

  if (!is_array($rss->items)) {
     # return "Feed error"; #localize...
      #return "<div>Failed to load RSS feed from $url!</div>"; #localize...
  }

  #Bild title line    
  #get title from argument-array    
  
  $rssTitle= @$args["title"];
  $rssTitle= trim($rssTitle);

  if ($rssTitle !=='none') {
    if ($rssTitle=='') {
        $title= iconv($charset,$wgOutputEncoding,$rss->channel['title']);
        if ($rss->channel['link']) $title= "[".$rss->channel['link']." $title]";
        $output = "=== $title ===\n";
    }
    else
    {
      $title= "[".$rss->channel['link']." $rssTitle]";
      $output="=== $title ===\n";
    }
  } else {
      $output="\n\n\n";
  }
  
  if ($reverse) $rss->items = array_reverse($rss->items);

  $description = False; 
  foreach ($rss->items as $item) {
      if ($item['description']) {$description = True; break;}
  }

  #Bild items
  if (!$short and $description) { #full item list

    $output.="";
    foreach ($rss->items as $item) {

      $d_text = true;
      $d_title = true;

      $href = trim(iconv($charset,$wgOutputEncoding,$item['link']));
      $title = trim(iconv($charset,$wgOutputEncoding,$item['title']));

      $d_title = wfRssFilter ($title, $rssFilter);
      $title= wfRssHighlight($title, $rssHighlight);

      #bild description text if desired
      if ($item["description"]) {
        $text= trim(iconv($charset,$wgOutputEncoding,$item['description']));

        #avoid pre-tags
        $text= str_replace("\r"," ",$text);
        $text= str_replace("\n"," ",$text);
        $text= str_replace("\t"," ",$text);

        $d_text = wfRssFilter ($text, $rssFilter);
        $text= wfRssHighlight($text, $rssHighlight);

        $display = $d_text or $d_title;

      }
        else   {
          $text = "";
          $display = $d_title;
        }       

      if ($display) {
        $output.="* [$href $title]";
        if ($text) $output.="<br>$text";
        $output .= "\n";
      }

    #Cut off output when maxheads is reached:
    if (++$headcnt == $maxheads)  break;

    }
    # $output.="</dl>";
  }
  else { #short item list
   #  $output.="<ul>";
    foreach ($rss->items as $item) {
      $href = trim(iconv($charset,$wgOutputEncoding,$item['link']));
      $title = trim(iconv($charset,$wgOutputEncoding,$item['title']));

        $d_title = wfRssFilter ($title, $rssFilter);
        $title= wfRssHighlight($title, $rssHighlight);

        if ($d_title ) $output.="* [$href $title]\n";

      #Cut off output when maxheads is reached:
      if (++$headcnt == $maxheads)  break;
    }
    # $output.="</ul>";
  }


  if ($DisableCache) {

    global $wgVersion;

    # Do not cache this wiki page.
    # for details see http://public.kitware.com/Wiki/User:Barre/MediaWiki/Extensions
    global $wgTitle, $wgDBprefix;
    $ts = mktime();
    $now = gmdate("YmdHis", $ts + 120);
    $ns = $wgTitle->getNamespace();
    $ti = wfStrencode($wgTitle->getDBkey());

    $version = preg_replace("/^([1-9]).([1-9]).*/", "\\1\\2", $wgVersion);
    if ($version>14) $sql = "UPDATE $wgDBprefix"."page SET page_touched='$now' WHERE page_namespace=$ns AND page_title='$ti'";
    else             $sql = "UPDATE $wgDBprefix"."cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'";

    wfQuery($sql, DB_WRITE, "");
  }

  $out = $parser->parse ($output, $parser->mTitle,$parser->mOptions, true, false);
  return $out->getText();
}


function wfRssFilter ($text, $rssFilter) {

  $display = true;

  if (is_array($rssFilter)) {
    foreach($rssFilter as $term) {

      if ($term) {
        $display = false;
        if (preg_match("|$term|i", $text, $a))  {  $display = true; return $display; }
      }
    if ($display) break;
    }
  }
  return $display;
}


function wfRssHighlight($text, $rssHighlight) {

  $i=0;
  $starttag = "v8x5u3t3u8h";
  $endtag   = "q8n4f6n4n4x";

  $color[]="coral";
  $color[]="greenyellow";
  $color[]="lightskyblue";
  $color[]="gold";
  $color[]="violet";

  $count_color = count($color);

  if (is_array($rssHighlight)) {
    foreach($rssHighlight as $term) {
      if ($term) {
        $text = preg_replace("|\b(\w*?".$term."\w*?)\b|i", "$starttag"."_".$i."\\1$endtag", $text);
        $i++;
        if ($i == $count_color) $i=0;
        }
      }
    }
  # to avoid trouble should someone wants to highlight the terms "span", "style", ...
  for ($i=0; $i<5; $i++) {
    $text = preg_replace("|$starttag"."_".$i."|", "<span style=\"background-color:".$color[$i]."; font-weight: bold;\">", $text);
    $text = preg_replace("|$endtag|", "</span>", $text);
    }

  return $text;
}

?>