Template:Mainpage-rssfeeds

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 16:20, 29 July 2006 by Ramuk (Talk | contribs) (RSS-Feed Mediawiki extension)

Jump to: navigation, search

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

India Ends Russian Space Partnership and Will Land On the Moon Alone

Sun, 24 May 2015 19:10:00

An anonymous reader writes: The Russian space program has experienced numerous accidents and delays recently, leading Indian officials to call into question its long term viability. Now India has decided to pull out of a partnership with Russia for a mission to the moon. According to the Examiner: "Previously, India was scheduled to launch a Russian lander on one of its rockets and send it to the lunar South Pole. Now, according to a story in Russia and India Report, India will go it alone, building its own lander to touch down on the lunar surface within the next few years.

Share on Google+


Read more of this story at Slashdot.

Dell Precision M3800 Mobile Workstation Packs Thunderbolt 2, Quadro, IGZO2 Panel

Sun, 24 May 2015 17:58:00

MojoKid writes: Dell recently revamped their M3800 model to better entice graphic designers, engineers, and other high-end users who often work in the field, with a true mobile workstation that's both sufficiently equipped to handle professional grade workloads and is thin and light to boot. Dell claims the M3800 is the "world's thinnest and lightest 15-inch mobile workstation" and at 4.15 pounds, it could very well be. In addition, ISV tools certifications matter for workstation types, so the M3800 gets its pixel pushing muscle from an NVIDIA Quadro K1100M GPU with 2GB of GDDR5 memory. Other notable specs include an Intel Core i7-4712HQ quad-core processor, 16GB of DDR3L memory, and a 256GB mSATA SSD. One of the new additions to the M3800 is a Thunderbolt 2 port with transfer speeds of up to 20Gbps that allows for the simultaneous viewing/editing and backing up of raw 4K video. Finally, the M3800 is equipped with a 3840x2160 native resolution IGZO2 display, which equates to a 60 percent increase in pixel density over a current gen MacBook Pro with Retina display. Performance-wise, the M3800 holds up pretty strong with standard productivity workloads, though as you can image it excels more-so in graphics rendering throughput.

Share on Google+


Read more of this story at Slashdot.

Al-Qaeda's Job Application Form Revealed

Sun, 24 May 2015 16:52:00

HughPickens.com writes: ABC News reports that the Office of the Director of National Intelligence has released a list of English-language material recovered during the raid the killed Osama bin Laden in Abbottabad, Pakistan in 2011 including one document dubbed "Instructions to Applicants," that would not be entirely out of place for an entry-level position at any American company – except for questions like the one about the applicant's willingness to blow themselves up. The questionnaire includes basic personal details, family history, marital status, and education level. It asks that applicants "answer the required information accurately and truthfully" and, "Please write clearly and legibly." Questions include: Is the applicant expert in chemistry, communications or any other field? Do they have a family member in the government who would cooperate with al Qaeda? Have they received any military training? Finally, it asks what the would-be jihadist would like to accomplish and, "Do you wish to execute a suicide operation?" For the final question, the application asks would-be killers that if they were to become martyrs, who should al Qaeda contact? The corporate tone of the application is jarringly amusing, writes Amanda Taub, but it also hints at a larger truth: a terrorist organization like al-Qaeda is a large bureaucratic organization, albeit one in the "business" of mass-murdering innocent people. Jon Sopel, the North American editor from BBC News, joked that the application "looks like it has been written by someone who has spent too long working for Deloitte or Accenture, but bureaucracy exists in every walk of life – so why not on the path to violent jihad?"

Share on Google+


Read more of this story at Slashdot.

Google and Gates-Backed Khan Academy Introduces "Grit"-Based Classroom Funding

Sun, 24 May 2015 15:46:00

theodp writes: Their intentions are no doubt good, but some will be troubled by Google and Khan Academy's recently-concluded LearnStorm initiative, which pitted kids-against-kids, schools-against-schools, and cities-against-cities in a 3-month learning challenge for prizes based not only on students' mastery of math skills on Khan Academy, but also their perceived 'hustle' (aka 'grit'). "Points are earned by mastering math skills and also for taking on challenging new concepts and persevering," explained a Khan Academy FAQ. A blog entry further explained, "They've earned points and prizes not only for mastering math skills but also for showing 'hustle,' a metric we created to measure grit, perseverance, and growth. They competed over 200,000 hours of learning and 13.6 million standards-aligned math problems. In addition, thanks to the generosity of Google.org, DonorsChoose.org, and Comcast's Internet Essentials, 34 underserved schools unlocked new devices for their classrooms and free home internet service for eligible families, increasing student access to online learning tools like Khan Academy." Apparently funded by a $2 million Google grant, the Google, Khan Academy, and DonorsChoose grit-based classroom funding comes on the heels of the same organizations' gender-based classroom funding initiative. Supported by some of the world's wealthiest individuals and corporations, Khan Academy's Board members include a Google Board member (Diane Green), spouse of a Google Board member (Ann Doerr), and the Managing Partner of Bill Gates' bgC3 (Larry Cohen); former Board members include Google Executive Chairman Eric Schmidt.

Share on Google+


Read more of this story at Slashdot.

A Beautiful Mind Mathematician John F. Nash Jr. Dies

Sun, 24 May 2015 14:40:00

Rick Zeman writes: John F. Nash Jr. revolutionized the mathematical field of game theory and was given a mind that was unique and deeply troubled. He became known to most people by the movie about his life, A Beautiful Mind. Dr. Nash died, along with his wife, May 24 in a two-car accident on the New Jersey Turnpike. The Washington Post reports: "In 1994, when Dr. Nash received the Nobel Prize in economics, the award marked not only an intellectual triumph but also a personal one. More than four decades earlier, as a Princeton University graduate student, he had produced a 27-page thesis on game theory — in essence, the applied mathematical study of decision-making in situations of conflict — that would become one of the most celebrated works in the field. Before the academic world could fully recognize his achievement, Dr. Nash descended into a condition eventually diagnosed as schizophrenia. For the better part of 20 years, his once supremely rational mind was beset by delusions and hallucinations. By the time Dr. Nash emerged from his disturbed state, his ideas had influenced economics, foreign affairs, politics, biology — virtually every sphere of life fueled by competition. But he been absent from professional life for so long that some scholars assumed he was dead."

Share on Google+


Read more of this story at Slashdot.


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

?>