Template:Mainpage-rssfeeds

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 16:27, 29 July 2006 by Ramuk (Talk | contribs) (Usage:)

Jump to: navigation, search

UNIQ0e0231d3b765ba7b-rss-00000000-QINU UNIQ0e0231d3b765ba7b-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>

MIT Scientists Develop New Wi-Fi That's 330% Faster

Wed, 24 Aug 2016 21:05:00

An anonymous reader quotes a report from MSN: Scientists at MIT claim to have created a new wireless technology that can triple Wi-Fi data speeds while also doubling the range of the signal. Dubbed MegaMIMO 2.0, the system will shortly enter commercialization and could ease the strain on our increasingly crowded wireless networks. Multiple-input-multiple-output technology, or MIMO, helps networked devices perform better by combining multiple transmitters and receivers that work simultaneously, allowing then to send and receive more than one data signal at the same time. MIT's MegaMIMO 2.0 works by allowing several routers to work in harmony, transmitting data over the same piece of spectrum. MIT claimed that during tests, MegaMIMO 2.0 was able to increase data transfer speed of four laptops connected to the same Wi-Fi network by 330 percent. Paper co-author Rahul said the technology could also be applied to mobile phone networks to solve similar congestion issues. "In today's wireless world, you can't solve spectrum crunch by throwing more transmitters at the problem, because they will all still be interfering with one another," Ezzeldin Hamed, lead author on a paper on the topic, told MIT News. "The answer is to have all those access points work with each other simultaneously to efficiently use the available spectrum."

Share on Google+


Read more of this story at Slashdot.

Bill Nye Explains That the Flooding In Louisiana Is the Result of Climate Change

Wed, 24 Aug 2016 20:27:00

Reader mspohr writes: Our favorite science guy has an interview (and video) in Quartz where he explains how Louisiana flooding is due to climate change:"As the ocean gets warmer, which it is getting, it expands," Nye explained. "Molecules spread apart, and then as the sea surface is warmer, more water evaporates, and so it's very reasonable that these storms are connected to these big effects."The article also notes that a National Academy of Sciences issued a report with the same findings: "Scientists from around the world have concurred with Nye that this is exactly what the effects of climate change look like, and that disasters like the Louisiana floods are going to happen more and more. According to a National Academy of Sciences report published earlier this year, extreme flooding can be traced directly to human-induced global warming. As the atmosphere warms, it retains more moisture, leading to bouts of sustained, heavy precipitation that can cause floods."

Share on Google+


Read more of this story at Slashdot.

Apple Under Tim Cook: More Socially Responsible, Less Visionary

Wed, 24 Aug 2016 19:45:00

Let's talk about Apple, unarguably one of the most remarkable companies on the face of the earth. (Remarkable doesn't necessarily mean great -- it just means that the company is something worth making a remark). You can like it, or hate it, but you can simply not ignore Apple. But what's the occasion, you ask? It's been five years since Tim Cook took over as Apple CEO. (Editor's note: auto-playing video ahead, which may annoy you) Under his leadership, Apple has grown to become the world's most successful company, doubling the stock price and registering a staggering 84 percent growth in its net worth. Media outlets are abuzz with articles, analysis, and over-analysis of Tim Cook's Apple today. Some excerpts from a CNN article: Apple's culture has changed noticeably, both for the better and the worse. [...] If Jobs put a dent in the universe through Apple's coveted products, Cook is making his mark by highlighting the importance of social efforts: LGBT rights, philanthropy, corporate diversity, renewable energy and improving manufacturing conditions abroad. Under Cook's leadership, Apple finally began matching charitable contributions from employees, which had long been a sore spot for staff. Apple had 110,000 full-time employees as of the end of September 2015, nearly doubling from the 60,400 employees it reported having in September 2011, shortly after Cook took over, according to annual filings with the SEC. [...] There's now a feeling among some Apple insiders that the company is just running the same product playbook that Jobs created in his final years at the helm. "For four or five years, the playbook is the same that's been done," says Amit Sharma, a former Apple exec on the online store team. But, he adds, "just because everybody is looking for new doesn't mean it's not working."

Share on Google+


Read more of this story at Slashdot.

Earth-Like Planet, With Ambitious Life Possibility, Found Orbiting the Star Next Door

Wed, 24 Aug 2016 19:00:00

There's another Earth out there. For real, this time. Astronomers announced on Wednesday that they had detected a planet orbiting Proxima Centauri, the closest neighbor to our solar system. Intriguingly, the planet is in the star's "Goldilocks zone," they said, a place that hints that it may not be too hot nor too cold. Which in turn means that liquid water could exist at the surface, and by extension, it raises the possibility of life. Nature reports:"The search for life starts now," says Guillem Anglada-Escude, an astronomer at Queen Mary University of London and leader of the team that made the discovery. Humanity's first chance to explore this nearby world may come from the recently announced Breakthrough Starshot initiative, which plans to build fleets of tiny laser-propelled interstellar probes in the coming decades. Travelling at 20% of the speed of light, they would take about 20 years to cover the 1.3 parsecs from Earth to Proxima Centauri. Proxima's planet is at least 1.3 times the mass of Earth. The planet orbits its red-dwarf star -- much smaller and dimmer than the Sun -- every 11.2 days. "If you tried to pick the type of planet you'd most want around the type of star you'd most want, it would be this," says David Kipping, an astronomer at Columbia University in New York City. "It's thrilling."Much about the planet is still unknown. Astronomers have some ideas about its size and distance from its parent star. Scientists say they are working off computer models that offer mere hints of what's possible. Also, there's no picture available for this planet as of yet.

Share on Google+


Read more of this story at Slashdot.

The US Army Has Too Many Video Games

Wed, 24 Aug 2016 18:12:00

An anonymous reader shares a Motherboard report:The US Army sees itself in a transitional period. Unlike a decade ago, soldiers are training less today on how to conduct "stability" operations for a counter-insurgency campaign, and more on what the Army does best: fighting other armies. But training is expensive and requires time and a lot of space. Training a gunner for an M-1 Abrams tank means reserving time on a limited number of ranges and expending real ammunition. So to lower costs and make training more efficient -- in theory -- the Army has adopted a variety of games to simulate war. There's just a few problems. Some of the Army's virtual simulators sit collecting dust, and one of them is more expensive and less effective than live training. At one base, soldiers preferred to play mouse-and-keyboard games over a more "realistic" virtual room. Then again, the Army has cooler games than you do. M-1 tank gunners, for example, can train inside a full-scale, computerized mock-up of their station called the Advanced Gunnery Training System, which comes inside a large transportable container. Instead of looking through real sights down a range, the soldier squints through a replica and sees a virtual simulacrum of, say, an enemy tank. Push a button and the "cannon" fires. The Army fields similar systems for the Stryker, a wheeled armored troop transport that fits an optional 105-millimeter gun. Soldiers train inside another simulated gunnery station for the M-2 Bradley fighting vehicle. Another system, Common Driver, simulates a variety of military vehicles.

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;
}

?>