Template:Mainpage-rssfeeds

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

Jump to: navigation, search

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

Data Can Help Fix America's Overcrowded Jails, Says White House

Fri, 01 Jul 2016 13:00:00

An anonymous reader writes from a report via CNET: The White House launched a program called the Data-Driven Justice (DDJ) initiative to help reduce the population of jails. It will allow states to better divert low-level offenders with mental illness out of the criminal justice system and keep low-risk defendants out of jail while they await trial. The DDJ program could help alleviate the cost and congestion facing many of America's local jails, which costs local governments nearly $22 billion a year for minor offenses and low-level non-violent misdemeanors. Every year, 11 million people move through America's local jails. In local jails, 64 percent of people suffer from mental illness, 68 percent have a substance abuse and 44 percent suffer from chronic health problems, according to the White House. Seven states and 60 communities committed to DDJ. The plan is to use data collected on individuals who are often in touch with the police, emergency departments and other services and link them to health, behavioral health and social services within the community. Law enforcement and first responders will also be trained in how to deal with people experiencing mental health issues to better direct them to the proper services. The administration is developing a toolkit that will guide jurisdictions toward the best practices, policies and programs that have been successful in DDJ communities. DDJ will also put in place pre-trial assessment tools to determine whether the individual can safely return to society while awaiting trial without having to post bond. Amazon Web Services is onboard with the project, planning to bring together data scientists, technologists, researchers and private sector collaborators in a Technology and Research Consortium to identify technology solutions and support DDJ communities. A mapping software company, Esri, has pledged half a million dollars worth of software and solutions to the DDJ communities as well. Meanwhile, AWS is providing the cloud-infrastructure, which should help share data between criminal justice and health care practitioners among DDJ communities.

Share on Google+


Read more of this story at Slashdot.

Microsoft President Brad Smith: Computer Science Is Space Race of Today

Fri, 01 Jul 2016 10:00:00

theodp writes: Q. How is K-12 computer science like the Cold War? A. It could use a Sputnik moment, at least that's the gist of an op-ed penned by Senator Jerry Moran (R., KS) and Microsoft President Brad Smith. From the article: "In the wake of the Soviet Union's 1957 Sputnik launch, President Eisenhower confronted the reality that America's educational standards were holding back the country's opportunity to compete on a global technological scale. He responded and called for support of math and science, which resulted in the National Defense Education Act of 1958 and helped send the country to the moon by the end of the next decade. It also created the educational foundation for a new generation of technology, leadership and prosperity. Today we face a similar challenge as the United States competes with nations across the globe in the indispensable field of computer science. To be up to the task, we must do a better job preparing our students for tomorrow's jobs." Smith is also a Board member of tech-bankrolled Code.org, which invoked Sputnik in its 2014 Senate testimony ("learning computer science is this generation's Sputnik moment") as it called for "comprehensive immigration reform efforts that tie H-1B visa fees to a new STEM education fund [...] to support the teaching and learning of more computer science," nicely echoing Microsoft's National Talent Strategy. Tying the lack of K-12 CS education to the need for tech visas is a time-honored tradition of sorts for Microsoft and politicians. As early as 2004, Bill Gates argued that CS education needed its own Sputnik moment, a sentiment shared by Senator Hillary Clinton in 2007 as she and fellow Senators listened to Gates make the case for more H-1B visas as he lamented the lack of CS-savvy U.S. high school students.

Share on Google+


Read more of this story at Slashdot.

Guccifer 2.0 Calls DNC Hack His "Personal Project," Mocks Security Firms

Fri, 01 Jul 2016 07:00:00

An anonymous reader writes: The notorious hacker most recently in the news for releasing Clinton Foundation documents has said on Thursday in a blog post that the stolen confidential files from the DNC was his "personal project." Guccifer 2.0, as he identifies himself as, added that security firms and the DNC may be trying to blame the attack on Russia, but "they can prove nothing! All I hear is blah-blah-blah, unfounded theories, and somebody's estimates," he wrote. He claims to be Romanian and says he acted alone, pouring water on the theory that he may be a "smokescreen" to divert attention away from the real culprits, that may have been expert hacking teams based in Russia. "I'd like to reveal a secret to all those cool IT-specialists: All the hackers in the world use almost the same tools," he said. "You can buy them or simply find them on the web." He broke into the network using a little-known vulnerability found in the DNC's software, he added. "The DNC used Windows on their server, so it made my work much easier," he said. "I installed my trojan-like virus on their PCs. I just modified the platform that I bought on the hacking forums for about $1.5k." Guccifer 2.0 also disputed the idea that the DNC breach was an intelligence gathering operation for Russia, saying it was hacktivism.

Share on Google+


Read more of this story at Slashdot.

'Healing' Detected In Antarctic Ozone Hole, Says Study

Fri, 01 Jul 2016 03:30:00

kheldan quotes a report from BBC: Researchers say they have found the first clear evidence that the thinning in the ozone layer above Antarctica is starting to heal. The scientists said that in September 2015 the hole was around 4 million sq km smaller than it was in the year 2000 -- an area roughly the size of India. The gains have been credited to the long term phasing out of ozone-destroying chemicals. [The study also sheds new light on the role of volcanoes in making the problem worse.] The ozone-destroying chemicals, chlorofluorocarbons (CFCs), have been shown to be declining in their influence, causing the ozone layer to grow once more. "Even though we phased out the production of CFCs in all countries including India and China around the year 2000, there's still a lot of chlorine left in the atmosphere," Prof Solomon told the BBC World Service Science in Action program. "It has a lifetime of about 50-100 years, so it is starting to slowly decay and the ozone will slowly recover." Scientists also believe that volcanic sulphur can form tiny particles that act as seeds to Polar Stratospheric Clouds, where chlorine chemistry occurs that destroys the ozone.

Share on Google+


Read more of this story at Slashdot.

Facebook To Shred 'Paper' News-Reading App On July 29th

Fri, 01 Jul 2016 01:30:00

An anonymous reader writes from a report via The Verge: Facebook's Paper app for iOS is scheduled to shut down on July 29th. While the app impressed critics, it failed to impress the general public. The Verge reports: "The app transformed the core Facebook experience into a kind of newsreader, with customizable sections for politics, technology, food, and other subjects. When it was introduced in January 2014, Paper signaled the beginning of a design renaissance at Facebook. The look and feel of the app were orchestrated by Mike Matas, whose design firm Push Pop Press was acquired by Facebook in 2011. Paper was notable for the novel animations it used to guide you through the app -- tap on a link and it would unfold like a letter; pull down on the story and it would fold back up, returning you to the feed. But despite the enormous growth of Facebook, which surged to 1.09 billion daily users this year, Paper has not been among the 1,500 most-downloaded apps since December 2014, according to research firm App Annie. It never came to Android, and the iOS version was last updated in March 2015. Facebook says that ideas from Paper have made their way into other Facebook apps, most notably Instant Articles, the fast-loading story format that the company introduced last year. Instant Articles borrowed several design elements from Paper, including full-bleed images and custom designs for individual publishers' articles."

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

?>