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

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

Tesla Unveils Dual Motor and Performance Specs For Model 3

Sun, 20 May 2018 23:23:00

Rei writes: Yesterday evening, Elon Musk announced the pricing and specs for two of the Model 3's most in-demand options -- dual motor and performance versions. The base dual motor configuration adds an AC induction front motor to the current partial-PM reluctance rear motor for $5,000; in addition to AWD and allowing the car to drive with either motor out, this cuts the 0 to 60 mph acceleration time from 5.1 seconds to 4.5 seconds. The performance package is available as a bundle, including the long-range pack, premium interior, 20" wheels, carbon fiber spoiler, and a new black-and-white interior. The vehicle will cost $78,000; 0 to 60 mph times are further cut to 3.5 seconds and the top speed increases from 140 mph to 155 mph. While these options have consistently polled as the most in-demand options not yet available, several still remain and are variously due late this year/early next year: cream interior, non-PUP, tow hitch, SR battery, and air suspension. EU-spec and China-spec are also due early next year. Production is currently over 3,500 per week, rumored to be 4,300 per week, and will be undergoing a shutdown from May 26-31 to raise production to the Q2 target of 5000-6000.

Share on Google+


Read more of this story at Slashdot.

'TeenSafe' Phone Monitoring App Leaked Thousands of User Passwords

Sun, 20 May 2018 22:22:00

An anonymous reader quotes a report from ZDNet: At least one server used by an app for parents to monitor their teenagers' phone activity has leaked tens of thousands of accounts of both parents and children. The mobile app, TeenSafe, bills itself as a "secure" monitoring app for iOS and Android, which lets parents view their child's text messages and location, monitor who they're calling and when, access their web browsing history, and find out which apps they have installed. But the Los Angeles, Calif.-based company left its servers, hosted on Amazon's cloud, unprotected and accessible by anyone without a password. "We have taken action to close one of our servers to the public and begun alerting customers that could potentially be impacted," said a TeenSafe spokesperson told ZDNet on Sunday. The database stores the parent's email address associated with their associated child's Apple ID email address. It also includes the child's device name -- which is often just their name -- and their device's unique identifier. The data contains the plaintext passwords for the child's Apple ID. Because the app requires that two-factor authentication is turned off, a malicious actor viewing this data only needs to use the credentials to break into the child's account to access their personal content data.

Share on Google+


Read more of this story at Slashdot.

Did Octopuses Come From Outer Space?

Sun, 20 May 2018 21:20:00

A scientific paper, originally published in March, from peer-reviewed journal Progress in Biophysics and Molecular Biology has found its way in this week's news-cycle. The paper, which is co-written by 33 authors including molecular immunologist Edward Steele and astrobiologist Chandra Wickramasinghe, suggests that octopuses could be aliens, adding legitimacy to a belief, which otherwise has been debunked several times in the recent years. An excerpt from the paper, which makes the bold claim: The genetic divergence of Octopus from its ancestral coleoid sub-class is very great ... Its large brain and sophisticated nervous system, camera-like eyes, flexible bodies, instantaneous camouflage via the ability to switch color and shape are just a few of the striking features that appear suddenly on the evolutionary scene. [...] It is plausible then to suggest they [octopuses] seem to be borrowed from a far distant 'future' in terms of terrestrial evolution, or more realistically from the cosmos at large."Ephrat Livni of Quartz questions the basis of the finding: To make matters even more strange, the paper posits that octopuses could have arrived on Earth in "an already coherent group of functioning genes within (say) cryopreserved and matrix protected fertilized octopus eggs." And these eggs might have "arrived in icy bolides several hundred million years ago." The authors admit, though, that "such an extraterrestrial origin...of course, runs counter to the prevailing dominant paradigm." Indeed, few in the scientific community would agree that octopuses come from outer space. But the paper is not just about the provenance of cephalopods. Its proposal that octopuses could be extraterrestrials is just a small part of a much more extensive discussion of a theory called "panspermia," which has its roots in the ideas of ancient Greece. Newsweek spoke with Avi Loeb, the Frank B. Baird Jr. Professor of Science at Harvard University, who told the publication that the paper has raised "an interesting but controversial possibility." However, he added, that it offers no "indisputable proof" that the Cambrian explosion is the result of panspermia. Further reading: Cosmos magazine has outlined some flaws in the assumptions that the authors made in the paper. It has also looked into the background of some of the authors. The magazine also points out that though the paper has made bold claims, it has yet to find support or corroboration from the scientific community. News outlet Live Science has also questioned the findings.

Share on Google+


Read more of this story at Slashdot.

Tesla Releases Some of Its Software To Comply With Open-Source Licenses

Sun, 20 May 2018 20:20:00

Jeremy Allison - Sam shares a blog post from Software Freedom Conservancy, congratulating Tesla on their first public step toward GPL compliance: Conservancy rarely talks publicly about specifics in its ongoing GNU General Public License (GPL) enforcement and compliance activity, in accordance with our Principles of Community Oriented GPL Enforcement. We usually keep our compliance matters confidential -- not for our own sake -- but for the sake of violators who request discretion to fix their mistakes without fear of public reprisal. We're thus glad that, this week, Tesla has acted publicly regarding its current GPL violations and has announced that they've taken their first steps toward compliance. While Tesla acknowledges that they still have more work to do, their recent actions show progress toward compliance and a commitment to getting all the way there.

Share on Google+


Read more of this story at Slashdot.

Bill Gates Shares His Memories of Donald Trump

Sun, 20 May 2018 19:19:00

MSNBC recently published a video of Bill Gates telling his staff at the Gates Foundation that he had two meetings with Donald Trump since the president was elected. In the video, Gates says Trump doesn't know the difference between two sexually transmitted diseases -- human papillomavirus (HPV) and human immunodeficiency virus (HIV) -- and that it was "scary" how much Trump knew about Gates' daughter's appearance. Gates also said he urged Trump to support innovation and technology during those meetings. CNN reports: Taking audience questions about his interactions with Trump at a Bill & Melinda Gates Foundation meeting, the former Microsoft honcho said he first met Trump in December 2016. He told the audience that Trump had previously come across his daughter, Jennifer, at a horse show in Florida. "And then about 20 minutes later he flew in on a helicopter to the same place," Gates said, according to video of the event broadcast by MSNBC late Thursday. "So clearly he had been driven away but he wanted to make a grand entrance in a helicopter. "Anyway, so when I first talked to him, it was actually kind of scary how much he knew about my daughter's appearance. Melinda (Gates' wife) didn't like that too well." Gates also said he discussed science with Trump on two separate occasions, where he says the President questioned him on the difference between HIV and HPV. "In both of those two meetings, he asked me if vaccines weren't a bad thing because he was considering a commission to look into ill-effects of vaccines and somebody -- I think it was Robert Kennedy Jr. -- was advising him that vaccines were causing bad things. And I said no, that's a dead end, that would be a bad thing, don't do that. "Both times he wanted to know if there was a difference between HIV and HPV so I was able to explain that those are rarely confused with each other," Gates said.

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

?>