article origin url
351641
public function beforeSave($insert)
    {
        if ($this->flag_headline == null) {
            $this->flag_headline = 0;
        }
        if ($this->flag_recommend == null) {
            $this->flag_recommend = 0;
        }
        if ($this->flag_slide_show == null) {
            $this->flag_slide_show = 0;
        }
        if ($this->flag_special_recommend == null) {
            $this->flag_special_recommend = 0;
        }
        if ($this->flag_roll == null) {
            $this->flag_roll = 0;
        }
        if ($this->flag_bold == null) {
            $this->flag_bold = 0;
        }
        if ($this->flag_picture == null) {
            $this->flag_picture = 0;
        }
        $this->tag = str_replace('，', ',', $this->tag);
        $this->seo_keywords = str_replace('，', ',', $this->seo_keywords);
        if ($insert) {
            $this->author_id = 0;
            $this->author_name = 'robot';

        } else {
            $this->updated_at = time();
        }
        $this->scrawThumb();
        return true;
    }
1117757
function encodeSummaryArticle(article, recursive) {
    var articles = undefined;
    if (recursive !== false) {
        articles = article.getArticles()
            .map(encodeSummaryArticle)
            .toJS();
    }

    return {
        title: article.getTitle(),
        level: article.getLevel(),
        depth: article.getDepth(),
        anchor: article.getAnchor(),
        url: article.getUrl(),
        path: article.getPath(),
        ref: article.getRef(),
        articles: articles
    };
}
364515
def show
      @first_page = true
      @article = Lines::Article.published.find(params[:id])
      @article.teaser = nil unless @article.teaser.present?
      meta_tags = { title: @article.title,
        type: 'article',
        url: url_for(@article),
        site_name: SITE_TITLE,
      }
      meta_tags[:image] = CONFIG[:host] + @article.image_url if @article.image_url.present?
      set_meta_tags title: @article.title,
                    keywords: KEYWORDS + @article.tag_list.to_s,
                    open_graph: meta_tags
      if request.path != article_path(@article)
        return redirect_to @article, status: :moved_permanently
      end

      @related_articles = Lines::Article.published.where('id != ?', @article.id).order('').limit(2)
    end
1212725
public function getCanonicalUrl()
    {
        if (($article = $this->getProduct())) {
            if ($article->oxarticles__oxparentid->value) {
                $article = $this->_getParentProduct($article->oxarticles__oxparentid->value);
            }

            $utilsUrl = \OxidEsales\Eshop\Core\Registry::getUtilsUrl();
            if (\OxidEsales\Eshop\Core\Registry::getUtils()->seoIsActive()) {
                $url = $utilsUrl->prepareCanonicalUrl($article->getBaseSeoLink($article->getLanguage(), true));
            } else {
                $url = $utilsUrl->prepareCanonicalUrl($article->getBaseStdLink($article->getLanguage()));
            }

            return $url;
        }
    }
582055
def make_article_info_dates(self):
        
        dates_div = etree.Element('div', {'id': 'article-dates'})

        d = './front/article-meta/history/date'
        received = self.article.root.xpath(d + "[@date-type='received']")
        accepted = self.article.root.xpath(d + "[@date-type='accepted']")
        if received:
            b = etree.SubElement(dates_div, 'b')
            b.text = 'Received: '
            dt = self.date_tuple_from_date(received[0], 'Received')
            formatted_date_string = self.format_date_string(dt)
            append_new_text(dates_div, formatted_date_string + '; ')
        if accepted:
            b = etree.SubElement(dates_div, 'b')
            b.text = 'Accepted: '
            dt = self.date_tuple_from_date(accepted[0], 'Accepted')
            formatted_date_string = self.format_date_string(dt)
            append_new_text(dates_div, formatted_date_string + '; ')
        #Published date is required
        pub_date = self.article.root.xpath("./front/article-meta/pub-date[@pub-type='epub']")[0]
        b = etree.SubElement(dates_div, 'b')
        b.text = 'Published: '
        dt = self.date_tuple_from_date(pub_date, 'Published')
        formatted_date_string = self.format_date_string(dt)
        append_new_text(dates_div, formatted_date_string)

        return dates_div
516288
def origin(self):
        
        with self.selenium.context(self.selenium.CONTEXT_CHROME):
            return self.root.get_attribute("origin")
1137805
public function getArticleMainUri($oArticle, $iLang)
    {
        startProfile(__FUNCTION__);

        $oMainCat = $this->_getMainCategory($oArticle);
        $sMainCatId = $oMainCat ? $oMainCat->getId() : '';

        //load default article url from DB
        if (!($sSeoUri = $this->_loadFromDb('oxarticle', $oArticle->getId(), $iLang, null, $sMainCatId, true))) {
            // save for main category
            if ($oMainCat) {
                $sSeoUri = $this->_createArticleCategoryUri($oArticle, $oMainCat, $iLang);
            } else {
                // get default article url
                $oArticle = $this->_getProductForLang($oArticle, $iLang);
                $sSeoUri = $this->_processSeoUrl($this->_prepareArticleTitle($oArticle), $oArticle->getId(), $iLang);

                // save default article url
                $this->_saveToDb(
                    'oxarticle',
                    $oArticle->getId(),
                    $oArticle->getBaseStdLink($iLang),
                    $sSeoUri,
                    $iLang,
                    null,
                    0,
                    ''
                );
            }
        }

        stopProfile(__FUNCTION__);

        return $sSeoUri;
    }
17238
def index
      respond_to do |format|
        format.html {
          @first_page = (params[:page] and params[:page].to_i > 0) ? false : true
          if params[:tag]
            @articles = Lines::Article.published.tagged_with(params[:tag]).page(params[:page].to_i)
          else
            @articles = Lines::Article.published.page(params[:page].to_i).padding(1)
          end
          
          if @articles.first_page?
            if @first_article = Article.published.first
              @first_article.teaser = nil unless @first_article.teaser.present?
            end
          end
          
          set_meta_tags title: SITE_TITLE,
                        description: CONFIG[:meta_description],
                        keywords: KEYWORDS,
                        open_graph: { title: SITE_TITLE,
                                        type: 'website',
                                        url: articles_url,
                                        site_name: SITE_TITLE,
                                        image: CONFIG[:og_logo]
                                      }

        }
        format.atom{
          @articles = Lines::Article.published
        }
      end
    end
1096806
function sameOrigin(url) {
  let origin = `${location.protocol}//${location.hostname}`;

  if (location.port) {
    origin += `:${location.port}`;
  }
  return url && url.indexOf(origin) === 0;
}
1023723
def origination_urls(self):
        
        if self._origination_urls is None:
            self._origination_urls = OriginationUrlList(self._version, trunk_sid=self._solution['sid'], )
        return self._origination_urls
149207
def help_center_user_articles(self, id, **kwargs):
        ""
        api_path = "/api/v2/help_center/users/{id}/articles.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
1000852
def article2draft(article):
    ''''''
    draft = Draft(article._content, article.metadata, article.settings,
                  article.source_path, article._context)
    draft.status = 'draft'
    return draft
863110
def t_ARTICLEHEADER(self, token):
        # \xef\xbc\x9a is the "fullwidth colon" used in Japanese for instance
        '
        number = token.lexer.lexmatch.group("number").decode("utf8")
        newtag = token.lexer.lexmatch.group("newtag").decode("utf8")
        oldtag = token.lexer.lexmatch.group("oldtag").decode("utf8")
        name = token.lexer.lexmatch.group("name").decode("utf8")
        sep = token.lexer.lexmatch.group("sep").decode("utf8")
        title = token.lexer.lexmatch.group("title").decode("utf8")
        token.value = (number, newtag, oldtag, name, title, sep)
        token.lexer.lineno += 1
        return token
538959
function createSite(refInfo) {
  let url = parseUrl(refInfo.referer);
  let result = {
    'domain': url.hostname,
    'page': url.protocol + '://' + url.hostname + url.pathname
  };
  if (self === top && document.referrer) {
    result.ref = document.referrer;
  }
  let keywords = document.getElementsByTagName('meta')['keywords'];
  if (keywords && keywords.content) {
    result.keywords = keywords.content;
  }
  return result;
}
177938
function extractOrigin(url) {
  if (!/^https?:\/\//.test(url)) url = window.location.href;
  var m = /^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(url);
  if (m) return m[1];
  return url;
}
404111
function (checkUrl) {
		var url;
		checkUrl = this.convAbsUrl(checkUrl);
		if (location.origin && window.URL) {
			try {
				url = new URL(checkUrl);
				return location.origin === url.origin;
			} catch(e) {}
		}
		url = document.createElement('a');
		url.href = checkUrl;
		return location.protocol === url.protocol && location.host === url.host && location.port && url.port;
	}
324098
def help_center_article_translation_show(self, article_id, locale, **kwargs):
        ""
        api_path = "/api/v2/help_center/articles/{article_id}/translations/{locale}.json"
        api_path = api_path.format(article_id=article_id, locale=locale)
        return self.call(api_path, **kwargs)