Maps the feed attributes to the sitelink placeholders.
196174
private static function createSitelinksFeedMapping(
        AdWordsServices $adWordsServices,
        AdWordsSession $session,
        array $sitelinksData
    ) {
        $feedMappingService =
            $adWordsServices->get($session, FeedMappingService::class);

        // Map the feed attribute IDs to the field ID constants.
        $linkTextFieldMapping = new AttributeFieldMapping();
        $linkTextFieldMapping->setFeedAttributeId(
            $sitelinksData['linkTextFeedAttributeId']
        );
        $linkTextFieldMapping->setFieldId(
            self::PLACEHOLDER_FIELD_SITELINK_LINK_TEXT
        );
        $linkFinalUrlFieldMapping = new AttributeFieldMapping();
        $linkFinalUrlFieldMapping->setFeedAttributeId(
            $sitelinksData['linkFinalUrlFeedAttributeId']
        );
        $linkFinalUrlFieldMapping->setFieldId(
            self::PLACEHOLDER_FIELD_SITELINK_FINAL_URL
        );
        $line2FieldMapping = new AttributeFieldMapping();
        $line2FieldMapping->setFeedAttributeId(
            $sitelinksData['line2FeedAttribute']
        );
        $line2FieldMapping->setFieldId(self::PLACEHOLDER_FIELD_LINE_2_TEXT);
        $line3FieldMapping = new AttributeFieldMapping();
        $line3FieldMapping->setFeedAttributeId(
            $sitelinksData['line3FeedAttribute']
        );
        $line3FieldMapping->setFieldId(self::PLACEHOLDER_FIELD_LINE_3_TEXT);

        // Create the feed mapping and feed mapping operation.
        $feedMapping = new FeedMapping();
        $feedMapping->setPlaceholderType(self::PLACEHOLDER_SITELINKS);
        $feedMapping->setFeedId($sitelinksData['sitelinksFeedId']);
        $feedMapping->setAttributeFieldMappings(
            [
                $linkTextFieldMapping,
                $linkFinalUrlFieldMapping,
                $line2FieldMapping,
                $line3FieldMapping
            ]
        );

        $operation = new FeedMappingOperation();
        $operation->setOperand($feedMapping);
        $operation->setOperator(Operator::ADD);

        // Create the feed mapping operation on the server and print out some
        // information.
        $result = $feedMappingService->mutate([$operation]);
        foreach ($result->getValue() as $feedMapping) {
            printf(
                'Feed mapping with ID %d and placeholder type %d was '
                . 'saved for feed with ID %d.%s',
                $feedMapping->getFeedMappingId(),
                $feedMapping->getPlaceholderType(),
                $feedMapping->getFeedId(),
                PHP_EOL
            );
        }
    }
1038739
public function linkToAllSiteRSSFeed()
    {
        if (!Config::inst()->get(VersionFeed::class, 'allchanges_enabled')
            || !SiteConfig::current_site_config()->AllChangesEnabled
        ) {
            return;
        }
        
        // RSS feed to all-site changes.
        $title = Convert::raw2xml($this->linkToAllSitesRSSFeedTitle());
        $url = $this->owner->getSiteRSSLink();

        Requirements::insertHeadTags(
            '<link rel="alternate" type="application/rss+xml" title="' . $title .
            '" href="' . $url . '" />'
        );
    }
443691
def add_html_link(app, pagename, templatename, context, doctree):
    """"""
    app.sitemap_links.append(pagename + ".html")
394823
def substitute_placeholders(inputstring, placeholders):
    
    newst = inputstring.format(link=placeholders.link,
                               filename=placeholders.filename,
                               directory=placeholders.directory,
                               fullpath=placeholders.fullpath,
                               title=placeholders.title,
                               filename_title=placeholders.filename_title,
                               date=placeholders.date_string(),
                               podcasttitle=placeholders.podcasttitle,
                               filename_podcasttitle=
                               placeholders.filename_podcasttitle,
                               name=placeholders.name,
                               subtitle=placeholders.sanitizedsubtitle,
                               entrysummary=placeholders.entrysummary)
    return newst
365843
protected function mapWebRoutes(): void
    {
        $file = $this->basePath.'routes/web.php';

        if (file_exists($file)) {
            $this->loadRoutesFrom(
                Route::middleware('web')
                ->group($file));
        }
    }
662531
private List<Link> parseAlternateLinks(final Feed feed, final Entry entry, final String baseURI, final List<Element> eLinks) {

        final List<Link> links = new ArrayList<Link>();
        for (final Element eLink : eLinks) {
            final Link link = parseLink(feed, entry, baseURI, eLink);
            if (link.getRel() == null || "".equals(link.getRel().trim()) || "alternate".equals(link.getRel())) {
                links.add(link);
            }
        }

        return Lists.emptyToNull(links);

    }
669988
def add_html_link(app, pagename, templatename, context, doctree):
    """"""
    base_url = app.config['html_theme_options'].get('base_url', '')
    if base_url:
        app.sitemap_links.append(base_url + pagename + ".html")
1098857
protected function buildMap(): void
    {
        // Fetch articles mapped from source to main.
        foreach ($this->pageMap->sourceIds() as $page) {
            $this->fetchArticlesFrom($page, $this->sourceMap, $this->pageMap->getMainFromSource($page));
        }
        $this->sourceMapInverse = array_flip($this->sourceMap);

        foreach ($this->pageMap->targetIds() as $page) {
            $this->fetchArticlesFrom($page, $this->targetMap, $this->pageMap->getMainFromTarget($page));
        }
        $this->targetMapInverse = array_flip($this->targetMap);

        $this->combineSourceAndTargetMaps();
    }
1224510
private function addSitemap()
    {
        $parsed = $this->parseURL($this->encode_url($this->current_word));
        if ($parsed !== false) {
            $this->sitemap[] = $this->current_word;
            $this->sitemap = array_unique($this->sitemap);
        }
    }
978232
private static Multimap<Long, Integer> getFeedMapping(AdWordsServicesInterface adWordsServices,
      AdWordsSession session, Feed feed, long placeholderType) throws RemoteException {
    // Get the FeedMappingService.
    FeedMappingServiceInterface feedMappingService =
        adWordsServices.get(session, FeedMappingServiceInterface.class);
    String query = String.format(
        "SELECT FeedMappingId, AttributeFieldMappings WHERE FeedId = %d and PlaceholderType = %d "
        + "AND Status = 'ENABLED'", feed.getId(), placeholderType);

    Multimap<Long, Integer> attributeMappings = HashMultimap.create();
    int offset = 0;
    FeedMappingPage feedMappingPage;

    do {
      String pageQuery = String.format(query + " LIMIT %d, %d", offset, PAGE_SIZE);
      feedMappingPage = feedMappingService.query(pageQuery);
      if (feedMappingPage.getEntries() != null) {
        // Normally, a feed attribute is mapped only to one field. However, you may map it to more
        // than one field if needed.
        for (FeedMapping feedMapping : feedMappingPage.getEntries()) {
          for (AttributeFieldMapping attributeMapping : feedMapping.getAttributeFieldMappings()) {
            attributeMappings.put(attributeMapping.getFeedAttributeId(),
                attributeMapping.getFieldId());
          }
        }
      }
      offset += PAGE_SIZE;
    } while (offset < feedMappingPage.getTotalNumEntries());

    return attributeMappings;
  }
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);
        
    }
1341395
def _set_data(self, action):
        
        if action == 'siteinfo':
            self._set_siteinfo()
        elif action == 'sitematrix':
            self._set_sitematrix()
        elif action == 'sitevisitors':
            self._set_sitevisitors()
257486
function(feed, summarise) {
    var template = ''
      , url = this.config.url
      , title = this.config.title
      , perPage = this.config.perPage
      , posts = this.posts.slice(0, perPage)
      , site = this;

    summarise = typeof summarise === 'boolean' && summarise ? 3 : summarise;
    perPage = site.posts.length < perPage ? site.posts.length : perPage;

    template += '!!!xml\n';
    template += 'feed(xmlns="http://www.w3.org/2005/Atom")\n';
    template += '  title #{title}\n';
    template += '  link(href=feed, rel="self")\n';
    template += '  link(href=url)\n';

    if (posts.length > 0)
      template += '  updated #{dx(posts[0].date)}\n';

    template += '  id #{url}\n';
    template += '  author\n';
    template += '    name #{title}\n';
    template += '  - for (var i = 0, post = posts[i]; i < ' + perPage + '; i++, post = posts[i])\n';
    template += '    entry\n';
    template += '      title #{post.title}\n';
    template += '      link(href=url + post.url)\n';
    template += '      updated #{dx(post.date)}\n';
    template += '      id #{url.replace(/\\/$/, "")}#{post.url}\n';

    if (summarise)
      template += '      content(type="html") !{h(truncateParagraphs(post.content, summarise, ""))}\n';
    else
      template += '      content(type="html") !{h(post.content)}\n';

    return helpers.render(template, { locals: site.applyHelpers({
        paginator: site.paginator
      , posts: posts
      , title: title
      , url: url
      , feed: feed
      , summarise: summarise
    })});
  }
109982
def links(self):
        """"""
        for match in self._href_re.finditer(self.content):
            url = match.group(1) or match.group(2) or match.group(3)
            url = self.clean_link(urlparse.urljoin(self.base_url, url))
            yield Link(url, self)
847567
def sitemap(self):
        """"""
        if (self.sitemap_name is not None):
            return(self.sitemap_name)
        return(self.sitemap_uri(self.resource_list_name))
580476
function link(scope, element, attrs) {
      scope.showProp = showProp;
      scope.display = ModelDefinitions.display;

      function showProp(propDef) {
        return !scope.narrowMode || propDef.displayPriority !== 'low';
      }
    }
256503
def add_sitemap_urls(self, rp, url_data, roboturl):
        """"""
        if not rp.sitemap_urls or not url_data.allows_simple_recursion():
            return
        for sitemap_url, line in rp.sitemap_urls:
            url_data.add_url(sitemap_url, line=line)