Template:Mainpage-rssfeeds

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

Jump to: navigation, search

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

Hyperloop One Announces Opening of Its First Manufacturing Plant

Thu, 28 Jul 2016 00:45:00

An anonymous reader quotes a report from TechCrunch: Hyperloop One is today announcing the opening of its first manufacturing plant. Called Hyperloop One Metalworks, the 105,000 square-foot building in North Las Vegas will be the new professional home of many of the company's 170 employees, including engineers, machinists and welders. These folks will build and test a number of components for the DevLoop, a full-system prototype of the Hyperloop, set for testing in 2017. The project, if successful, promises a half-hour travel time between Stockholm and Helsinki, which is the equivalent of about 300 miles. The company plans to have a working prototype of the Hyperloop by 2017 thanks to this new plant."Hyperloop One Metalworks is the first Hyperloop manufacturing plant in the world," said co-founder and President of Engineering Josh Giegel in a press release. "The ability to have a world-class machine shop in-house gives us an advantage to build rapidly and develop the Hyperloop in real-time."

Share on Google+


Read more of this story at Slashdot.

ALS Ice Bucket Challenge Funding Leads To New Genetic Findings

Thu, 28 Jul 2016 00:05:00

An anonymous reader writes: Researchers are crediting the ALS Ice Bucket Challenge, a fundraiser for amyotrophic lateral sclerosis that went viral in 2014, for funding a new study that has possibly identified a common gene that contributes to the nervous system disease. Yahoo reports via Good Morning America: "In a study published in The Nature Genetics Journal, researchers from various institutions, including the University of Massachusetts Medical School and the University Medical Center Utrecht, identified the gene NEK1 as a common gene that could have an impact on who develops the disease. Variants of the gene appear to lead to increased risk of developing ALS, according to preliminary findings. Researchers in 11 countries studied 1,000 families in which a family member developed ALS and conducted a genome-wide search for any signs that a gene could be leading to increased ALS risk. After identifying the NEK1 gene, they also analyzed 13,000 individuals who had developed ALS despite no family history and found they had variants in that same gene, again linking that gene with increased ALS risk. Starting in the summer of 2014, the ALS Ice Bucket Challenge led to 17 million videos made and $220 million raised, according to the ALS Association -- $115 million of which went to the association."

Share on Google+


Read more of this story at Slashdot.

Office 365 Gets New Word, PowerPoint and Outlook Features

Wed, 27 Jul 2016 23:20:00

New submitter Miche67 writes: As part of the July 2016 update to Office 365, Microsoft is adding several features across the board to Word, PowerPoint and Outlook. Word, however, is getting the biggest new features -- Researcher and Editor -- to improve your writing. "As its name implies, Researcher is designed to help the user find reliable sources of information by using the Bing Knowledge Graph to search for sources, and it will properly cite them in the Word document," reports Network World. "[Editor] builds on the already-existing spellchecker and thesaurus to offer suggestions on how to improve your overall writing. In addition to the wavy red line under a misspelled word and the wavy blue line under bad grammar, there will be a gold line for writing style." The new features are expected to be available later this year. In addition to the two new features added to PowerPoint last year -- Designer and Morph, Microsoft is offering Zoom, a feature that lets you easily create "interactive, non-linear presentations." "Instead of the 1-2-3-4 linear method of presenting slides, forcing you to place them all in the order you wish to display, presenters will be able to show their slides in any order they want at any time," reports Network World. "This way you can change your presentation order as needed without having to stop PowerPoint or interrupt the display." As for Outlook, Focused Inbox is coming to Office 365. Focused Inbox separates your inbox into two tabs. The "Focused" tab is where all of your high-priority emails will be found, while everything else will be in the "Other" tab. Outlook will learn from your behavior over time and sort your mail accordingly. In addition, @mentions are coming to Outlook 365 and Outlook for PC and Mac, "making it easy to identify emails that need your attention, as well as flag actions for others."

Share on Google+


Read more of this story at Slashdot.

Amazon Debuts a Dedicated Shop For Kickstarter Products

Wed, 27 Jul 2016 22:40:00

An anonymous reader quotes a report from TechCrunch: Today, Amazon announced it's teaming up with Kickstarter to offer those successful Kickstarter products a way to reach more customers through a dedicated section on Amazon's website. Via www.amazon.com/launchpad/kickstarter, the online retailer is now featuring a group of over 300 Kickstarter products across a variety of categories, like electronics, books, home and kitchen, movies and tv, and more. The products can also be browsed by theme, like STEM products, "Always be Learning," "Exquisite Objects," "Inventing the Future," and "Public Benefit," for example. The new Kickstarter section is actually an expansion on Amazon's Launchpad platform, launched a year ago. In July 2015, the retailer debuted a dedicated portal that offered both marketing and sales for hardware and physical goods from younger tech companies. Today, Amazon says it has now worked with over 100 VCs, accelerators and crowdfunders and has helped more than 1,000 launch products across the U.S., the U.K., China, Germany, and France. All startups who participate in Launchpad receive custom product pages, a comprehensive marketing package, and access to Amazon's global fulfillment network, the retailer notes.

Share on Google+


Read more of this story at Slashdot.

One Billion iPhones Have Been Sold, Apple Says

Wed, 27 Jul 2016 22:00:00

Apple announced on Wednesday that it has sold its one billionth iPhone handset. The milestone comes nine years after the iPhone was first introduced. The phone has unarguably shaped the smartphone industry and bolstered the apps market. In a statement, Tim Cook said: iPhone has become one of the most important, world-changing and successful products in history. It's become more than a constant companion. iPhone is truly an essential part of our daily life and enables much of what we do throughout the day. Last week we passed another major milestone when we sold the billionth iPhone. We never set out to make the most, but we've always set out to make the best products that make a difference. Thank you to everyone at Apple for helping change the world every day.

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

?>