Short description of method feed

@access public
@author Joel Bout, <joel.bout@tudor.lu>
511788
public function feed()
    {
        common_Logger::t('Evaluating AsyncFile ' . $this->getName(), array(
            'TAO'));
        if (isset($_POST[$this->name])) {
            $struct = json_decode($_POST[$this->name], true);
            if ($struct !== false) {
                $this->setValue($struct);
            } else {
                common_Logger::w('Could not unserialise AsyncFile field ' . $this->getName(), array(
                    'TAO'));
            }
        }
    }
1319946
public function run() {
		
		$id = $this->id;
		$content = array();
		$items = $this->normalizeTabs($this->tabs, $content);

		ob_start();
		$this->controller->widget(
			'booster.widgets.TbMenu',
			array(
				'stacked' => $this->stacked,
				'justified' => $this->justified,
				'type' => $this->type,
				'encodeLabel' => $this->encodeLabel,
				'htmlOptions' => $this->tabMenuHtmlOptions,
				'items' => $items,
			)
		);
		$tabs = ob_get_clean();

		ob_start();
		echo CHtml::openTag('div', $this->tabContentHtmlOptions);
		echo implode('', $content);
		echo CHtml::closeTag('div');
		$content = ob_get_clean();

		echo CHtml::openTag('div', $this->htmlOptions);
		echo $this->placement === self::PLACEMENT_BELOW ? $content . $tabs : $tabs . $content;
		echo CHtml::closeTag('div');

		/** @var CClientScript $cs */
		$cs = Yii::app()->getClientScript();
		$cs->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').tab('show');");

		foreach ($this->events as $name => $handler) {
			$handler = CJavaScript::encode($handler);
			$cs->registerScript(__CLASS__ . '#' . $id . '_' . $name, "jQuery('#{$id}').on('{$name}', {$handler});");
		}
	}
516247
public function feed()
    {
        
    	$values = array();
    	$prefix = preg_quote($this->getPrefix(), '/');
    	foreach($_POST as $key => $value){
    		if(preg_match("/^$prefix/", $key)){
    			$values[str_replace($this->getPrefix(), '', $key)] = $value;
    		}
    	}
    	$this->setValues($values);
        
    }
66581
function feed(cb) {
  return function (args) {
    function resultCb(result) {
      result.forEach(function (article) {
        console.log(article.title);
      });
    }
    function jenkinsCb(jenkins) {
      if (args.job) {
        jenkins.parseJobFeed(args.job, cli.exitCb(null, resultCb));
      } else if (args.view) {
        jenkins.parseViewFeed(args.view, cli.exitCb(null, resultCb));
      } else {
        jenkins.parseFeed(cli.exitCb(null, resultCb));
      }
    }
    cb(args, jenkinsCb);
  };
}
145588
def pretty_print(session, feed):
    
    if feed in session.feeds:
        print()
        feed_info = os.path.join(session.data_dir, feed)
        entrylinks, linkdates = parse_feed_info(feed_info)
        print(feed)
        print("-"*len(feed))
        print(''.join(["    url: ", session.feeds[feed]["url"]]))
        if linkdates != []:
            print(''.join(["    Next sync will download from: ", time.strftime(
                "%d %b %Y %H:%M:%S", tuple(max(linkdates))), "."]))
    else:
        print("You don't have a feed called {}.".format(feed), file=sys.stderr,
              flush=True)
1254912
protected function determineFeedType()
    {
        $feedType = strtolower($this->getRoutedParameter('feedType', static::TYPE_JSON));

        if ($feedType == static::TYPE_JSON) {
            $this->displayResolver = static::RESOLVER_JSON;
            if (empty($this->callback))
            {
                $this->contentType = static::CONTENT_TYPE_JSON;
            }
            else
            {
                $this->contentType = static::CONTENT_TYPE_JSONP;
            }
            return;
        }

        if ($feedType == static::TYPE_XML)
        {
            $this->displayResolver = static::RESOLVER_XML;
            $this->contentType = static::CONTENT_TYPE_XML;
            return;
        }

        $this->setNotReady("Please specify a valid feed type in the parameter feedType.");
    }
1289885
public function load()
	{
		if ($this->mysql === null)
		{
			return false;
		}

		$query = $this->mysql->prepare('SELECT `items`, `data` FROM `' . $this->options['extras']['prefix'] . 'cache_data` WHERE `id` = :id');
		$query->bindValue(':id', $this->id);
		if ($query->execute() && ($row = $query->fetch()))
		{
			$data = unserialize($row[1]);

			if (isset($this->options['items'][0]))
			{
				$items = (int) $this->options['items'][0];
			}
			else
			{
				$items = (int) $row[0];
			}

			if ($items !== 0)
			{
				if (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'][0];
				}
				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['feed'][0];
				}
				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RDF]['RDF'][0];
				}
				elseif (isset($data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0]))
				{
					$feed =& $data['child'][SIMPLEPIE_NAMESPACE_RSS_20]['rss'][0];
				}
				else
				{
					$feed = null;
				}

				if ($feed !== null)
				{
					$sql = 'SELECT `data` FROM `' . $this->options['extras']['prefix'] . 'items` WHERE `feed_id` = :feed ORDER BY `posted` DESC';
					if ($items > 0)
					{
						$sql .= ' LIMIT ' . $items;
					}

					$query = $this->mysql->prepare($sql);
					$query->bindValue(':feed', $this->id);
					if ($query->execute())
					{
						while ($row = $query->fetchColumn())
						{
							$feed['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['entry'][] = unserialize($row);
						}
					}
					else
					{
						return false;
					}
				}
			}
			return $data;
		}
		return false;
	}
1157492
private void doFeed() {
    if (fed && !output.sendQueueFull()) {
      fed = false;
      vertx.runOnContext(feedRunner);
    } else {
      feedTimer = vertx.setTimer(feedDelay, recursiveRunner);
    }
  }
409972
private String parseRssFeed(String feed) {
        String[] result = feed.split("<br />");
        String[] result2 = result[2].split("<BR />");

        return result2[0];
    }
370701
public function parse()
    {

        // TODO - Use feed names with alias style like FBL
        // TODO - Use both DATE fields
        // TODO - Try YAML parser?

        $this->feedName = 'default';

        if ($this->isKnownFeed() && $this->isEnabledFeed() && $this->hasArfMail()) {
            // As this is a generic FBL parser we need to see which was the source and add the name
            // to the report, so its origin is clearly shown.
            $source = $this->parsedMail->getHeader('from');
            foreach (config("{$this->configBase}.parser.aliases") as $from => $alias) {
                if (preg_match($from, $source)) {
                    // If there is an alias, prefer that name instead of the from address
                    $source = $alias;

                    // If there is an more specific feed configuration prefer that config over the default
                    if (!empty(config("{$this->configBase}.feeds.{$source}"))) {
                        $this->feedName = $source;
                    }

                }
            }

            if (preg_match_all('/([\w\-]+): (.*)[ ]*\r?\n/', $this->arfMail['report'] . PHP_EOL, $regs)) {
                $report = array_combine($regs[1], $regs[2]);

                if (empty($report['Received-Date'])) {
                    if (!empty($report['Arrival-Date'])) {
                        $report['Received-Date'] = $report['Arrival-Date'];
                        unset($report['Arrival-Date']);
                    }
                }

                if ($this->hasRequiredFields($report) === true) {
                    // incident has all requirements met, filter and add!
                    if ($report['Feedback-Type'] != 'abuse') {
                        return $this->failed(
                            "Unabled to detect the report type from this notifier"
                        );
                    }

                    $report = $this->applyFilters($report);

                    $report['evidence'] = $this->arfMail['evidence'];

                    $incident = new Incident();
                    $incident->source      = $source;
                    $incident->source_id   = false;
                    $incident->ip          = $report['Source-IP'];
                    $incident->domain      = false;
                    $incident->class       = config("{$this->configBase}.feeds.{$this->feedName}.class");
                    $incident->type        = config("{$this->configBase}.feeds.{$this->feedName}.type");
                    $incident->timestamp   = strtotime($report['Received-Date']);
                    $incident->information = json_encode($report);

                    $this->incidents[] = $incident;

                }
            } else {
                $this->warningCount++;
            }
        }

        return $this->success();
    }
1211804
def _subfeed(self, feedname):
        
        url = self.url
        if not url.endswith("/"):
            url += "/"
        return url + feedname
104869
public function feedDataTable()
    {
        if (!$this->isXmlHttpRequest()) {
            throw new \Exception('Only ajax call allowed.');
        }

        if (!$this->hasRequestParameter(self::PARAMETER_COLUMNS)) {
            throw new common_Exception('Parameter "'. self::PARAMETER_COLUMNS .'" missing');
        }

        $this->returnJson((new ResultsPayload($this->getExporterService()->getExporter()))->getPayload());
    }
1026261
public function ingestAllFeeds()
    {
        $feeds = $this->getFeeds();

        if (count($feeds) > 0) {

            $updated = array();
            foreach ($feeds as $feed) {
                $updated[] = $this->updateFeed($feed, false);
            }

            $this->liftEmbargo();

            return count($updated);
        } else {
            return 0;
        }
    }
524889
private function consume() {
        $this->i++;
        if ($this->i >= $this->len) {
            $this->ch = self::EOF;
        } else {
            $this->ch = $this->docComment[$this->i];
        }
    }
73586
public function processFeed($url, $data)
    {
        $logger = $this->getLogger();
        $logger->info('Processing feed', array('url' => $url));
        $logger->debug('Received feed data', array('data' => $data));

        try {
            $new = iterator_to_array(FeedReader::importString($data));
            $old = isset($this->cache[$url]) ? $this->cache[$url] : array();
            $diff = $this->getNewFeedItems($new, $old);
            if ($old) {
                $this->syndicateFeedItems($diff);
            }
            $this->cache[$url] = $new;
        } catch (\Exception $e) {
            $logger->warning(
                'Failed to process feed',
                array(
                    'url' => $url,
                    'data' => $data,
                    'error' => $e,
                )
            );
        }

        $this->queuePoll($url);
    }
1346714
public function generateFeed()
	{
		// TODO Вынести возврат заголовков в отдельный метод
		//header("Content-type: text/xml");

		$feed =
			$this->generateHead() .
			$this->generateChannels() .
			$this->generateItems() .
			$this->generateTale();

		return $feed;
	}
963923
function(credentials, callback_url, api_endpoint) {
  this._credentials = credentials;
  this._callback    = callback_url;
  this._endpoint    = api_endpoint;
  this._fields      = "feed";
}