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

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

New Apps Let Women Obtain Birth Control Without Visiting a Doctor

Sat, 25 Jun 2016 03:30:00

HughPickens.com writes: With nearly 40 percent of all pregnancies in the United States unintended, birth control is a critical public health issue. For short-term methods, visiting the doctor for a prescription can be time-consuming and sometimes costly and for some, like teenagers, it can be intimidating or embarrassing. Now Pam Belluck reports at the NYT that a growing assortment of new apps and websites now make it possible to get prescription contraceptives without going to the doctor as public health experts hope the new apps will encourage more women to start, or restart, using contraception and help reduce the country's stubbornly high rate of unintended pregnancies, as well as the rate of abortions. At least six digital ventures, by private companies and nonprofits, including Planned Parenthood, now provide prescriptions written by clinicians after women answer questions about their health online or by video. All prescribe birth control pills, and some prescribe patches, rings and morning-after pills and some ship contraceptives directly to women's doors. "At first I didn't believe it," said Susan Hashem, who wanted to restart birth control pills without missing work for a doctor's appointment. Hashem used an app called Lemonaid and paid $15 for a doctor to review her medical information and send a pill prescription to a local pharmacy. "I thought it was just a setup to get money," Hashem said. But after she answered the health questions one evening, "a doctor actually contacted me after office hours," and the next morning, she picked up three months' worth of pills.

Share on Google+


Read more of this story at Slashdot.

Robot Pizza Company 'Zume' Wants To Be 'Amazon of Food'

Sat, 25 Jun 2016 01:25:00

kheldan writes: Do you want robots making your pizza? Alex Garden, co-founder and executive chairman of Mountain View startup Zume, is betting you will. Garden, the former president of Zynga Studios, was previously a general manager of Microsoft's Xbox Live. Garden launched Zume in stealth mode last June, when he began quietly recruiting engineers under a pseudonym and building his patented trucks in an unmarked Mountain View garage. In September, he brought on Julia Collins, a 37-year-old restaurant veteran. She became chief executive officer and a co-founder. Collins was previously the vice president and CEO of Harlem Jazz Enterprises, the holding company for Minton's, a historic Harlem eatery. The company consists of an army of robot sauce-spreaders and trucks packed full of ovens. "In the back of Mountain View's newest pizzeria, Marta works tirelessly, spreading marinara sauce on uncooked pies. She doesn't complain, takes no breaks, and has never needed a sick day. She works for free." The pie then "travels on a conveyer belt to human employees who add cheese and toppings." From there, "The decorated pies are then scooped off the belt by a 5-foot tall grey automation, Bruno, who places each in a 850-degree oven. For now, the pizzas are fully cooked and delivered to customers in branded Fiats painted with slogans, including: 'You want a piece of this?' and 'Not part of the sharing economy.'" Garden says, "We are going to be the Amazon of food. [...] Just imagine Domino's without the labor component. You can start to see how incredibly profitable that can be."

Share on Google+


Read more of this story at Slashdot.

Scientists Force Computer To Binge On TV Shows and Predict What Humans Will Do

Sat, 25 Jun 2016 00:45:00

An anonymous reader quotes a report from GeekWire: Researchers have taught a computer to do a better-than-expected job of predicting what characters on TV shows will do, just by forcing the machine to study 600 hours' worth of YouTube videos. The researchers developed predictive-vision software that uses machine learning to anticipate what actions should follow a given set of video frames. They grabbed thousands of videos showing humans greeting each other, and fed those videos into the algorithm. To test how much the machine was learning about human behavior, the researchers presented the computer with single frames that showed meet-ups between characters on TV sitcoms it had never seen, including "The Big Bang Theory," "Desperate Housewives" and "The Office." Then they asked whether the characters would be hugging, kissing, shaking hands or exchanging high-fives one second afterward. The computer's success rate was 43 percent. That doesn't match a human's predictive ability (72 percent), but it's way better than random (25 percent) as well as the researchers' benchmark predictive-vision programs (30 to 36 percent). The point of the research is to create robots that do a better job of anticipating what humans will do. MIT's Carl Vondrick and his colleagues are due to present the results of their experiment next week at the International Conference on Computer Vision and Pattern Recognition in Las Vegas. "[The research] could help a robot move more fluidly through your living space," Vondrick told The Associated Press. "The robot won't want to start pouring milk if it thinks you're about to pull the glass away." You can watch their YouTube video to learn more about the experiment.

Share on Google+


Read more of this story at Slashdot.

NASCAR Team Pays Ransomware Fee To Recover Files Worth $2 Million

Sat, 25 Jun 2016 00:05:00

An anonymous reader writes: "NASCAR team Circle Sport-Leavine Family Racing (CSLFR) revealed today it faced a ransomware infection this past April when it almost lost access to crucial files worth nearly $2 million, containing car parts lists and custom high-profile simulations that would have taken 1,500 man-hours to replicate," reports Softpedia. "The infection took place on the computer belonging to CSLFR's crew chief. Winston's staff detected the infection when encrypted files from Winston's computer began syncing to their joint Dropbox account." It was later discovered that he was infected with the TeslaCrypt ransomware. Because the team had no backups of the crucial data, they eventually paid the ransom (around $500). This happened before TeslaCrypt's authors decided to shut down their operations and release free decryption keys.

Share on Google+


Read more of this story at Slashdot.

You Could Be Paid To Post Snapchat Selfies With Products, Patent Filing Suggests

Fri, 24 Jun 2016 23:20:00

An anonymous reader writes: According to Snapchat's latest patent filings, the company could begin paying users to post photos and videos. Los Angeles Times reports: "The filings reveal that Snapchat automatically could analyze annotations on an image, including text and digital stickers, to prompt users to place their image in a collective gallery. In other words, people who type some variation of 'Clippers!!!' on top of their photo during a Clippers basketball game would have access to a library of images related to the game. Especially intriguing, the company could use computer vision technology to identify objects in an image -- say, a Coke bottle -- to encourage a user to share the shot in a Coca-Cola-sponsored story. Contributors could walk away with cash through a flat fee or some other deal based on views or sales generated by the story. The idea in the patent filing also would give advertisers an official way to compensate people for creative posts, compared with the usual strategy of paying top users to turn their personal accounts into an ad. Other types of automatically generated galleries mentioned in the patent application include stories based on a time stamp, temperature or movement. People could definite their own categories too. Curation of the galleries could be optional, with object recognition and text analysis as potential ways to filter inappropriate submissions. Users who get into audio timeline could get paid too, the patent filing states."

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

?>