GET /articles
 GET /articles.json
776236
def index
      @articles = Article.all

      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @articles }
      end
    end
421033
def document
      json = Net::HTTP.get_response URI.parse(query_string(@query))
      json.body
    end
86422
function indexArticleLevels(article, baseLevel) {
    baseLevel = baseLevel || article.getLevel();
    var articles = article.getArticles();

    articles = articles.map(function(inner, i) {
        return indexArticleLevels(inner, baseLevel + '.' + (i + 1));
    });

    return article.merge({
        level: baseLevel,
        articles: articles
    });
}
1037464
public function getArticles()
    {
        if (is_null($this->_aArtIds)) {
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sQ = "select oxobjectid from oxobject2delivery where oxdeliveryid=" . $oDb->quote($this->getId()) . " and oxtype = 'oxarticles'";
            $aArtIds = $oDb->getCol($sQ);
            $this->_aArtIds = $aArtIds;
        }

        return $this->_aArtIds;
    }
1306776
def get_articles(self, issue=''):
        	
		
		
	soup = get_soup() # get soup of all articles 
	issues = soup.find_all('ul')
		
	# validating and assigning default value for issue
	if not type(issue) is int or issue < 0 :
		issue = 1
	if issue > len(issues):
		issue = len(issues)		
		
	# considering latest article is last element 		
	articles = issues[len(issues)-issue].find_all('a') 
	mArticles = []
	for article in articles:
		mArticle = {}
		mArticle['link'] = article.get('href')[1:]
		mArticle['title'] = article.find('li').contents[0].strip()
		mArticle['author'] = article.find('span').contents[0].encode('utf8')
		mArticles.append(mArticle)
	return mArticles
532513
def _getNextArticleBatch(self):
        """"""
        eventUri = self.queryParams["eventUri"]
        # move to the next page to download
        self._articlePage += 1
        # if we have already obtained all pages, then exit
        if self._totalPages != None and self._articlePage > self._totalPages:
            return
        if self._er._verboseOutput:
            print("Downloading article page %d from event %s" % (self._articlePage, eventUri))

        self.setRequestedResult(RequestEventArticles(
            page = self._articlePage,
            sortBy = self._articlesSortBy, sortByAsc = self._articlesSortByAsc,
            returnInfo = self._returnInfo,
            **self.queryParams))
        res = self._er.execQuery(self)
        if "error" in res:
            print(res["error"])
        else:
            self._totalPages = res.get(eventUri, {}).get("articles", {}).get("pages", 0)
        arts = res.get(eventUri, {}).get("articles", {}).get("results", [])
        self._articleList.extend(arts)
729084
public function uploadArticle($articles)
    {
        if (!empty($articles['title']) || $articles instanceof Article) {
            $articles = [$articles];
        }

        $params = ['articles' => array_map(function ($article) {
            if ($article instanceof Article) {
                return $article->only([
                    'title', 'thumb_media_id', 'author', 'digest',
                    'show_cover_pic', 'content', 'content_source_url',
                ]);
            }

            return $article;
        }, $articles)];

        return $this->parseJSON('json', [self::API_NEWS_UPLOAD, $params]);
    }
629096
def get_article(self, article_id):
        
        url = self._generate_url('articles/{0}'.format(article_id))
        return self.get(url)
1287614
def update_article(self, article_id, article_dict):
        
        return self._create_put_request(resource=ARTICLES, billomat_id=article_id, send_data=article_dict)
914737
def help_center_article_translation_update(self, article_id, locale, data, **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, method="PUT", data=data, **kwargs)
65582
def json(self):
        '''  '''
        if 'application/json' in self.environ.get('CONTENT_TYPE', '') \
        and 0 < self.content_length < self.MEMFILE_MAX:
            return json_loads(self.body.read(self.MEMFILE_MAX))
        return None
1051761
def _get_content_json(ident_hash=None):
    """"""
    request = get_current_request()
    routing_args = request and request.matchdict or {}
    if not ident_hash:
        ident_hash = routing_args['ident_hash']

    as_collated = asbool(request.GET.get('as_collated', True))
    page_ident_hash = routing_args.get('page_ident_hash', '')
    p_id, p_version = (None, None)
    if page_ident_hash:
        try:
            p_id, p_version = split_ident_hash(page_ident_hash)
        except IdentHashShortId as e:
            p_id = get_uuid(e.id)
            p_version = e.version
        except IdentHashMissingVersion as e:
            # page ident hash doesn't need a version
            p_id = e.id
            p_version = None

    id, version = split_ident_hash(ident_hash, containing=p_id)

    with db_connect() as db_connection:
        with db_connection.cursor() as cursor:
            result = get_content_metadata(id, version, cursor)
            # Build url for canonical link header
            result['canon_url'] = get_canonical_url(result, request)

            if result['mediaType'] == COLLECTION_MIMETYPE:
                # Grab the collection tree.
                result['tree'] = get_tree(ident_hash, cursor,
                                          as_collated=as_collated)
                result['collated'] = as_collated
                if not result['tree']:
                    # If collated tree is not available, get the uncollated
                    # tree.
                    result['tree'] = get_tree(ident_hash, cursor)
                    result['collated'] = False

                if page_ident_hash:
                    for id_ in flatten_tree_to_ident_hashes(result['tree']):
                        id, version = split_ident_hash(id_)
                        if id == p_id and (
                           version == p_version or not p_version):
                            content = None
                            if as_collated:
                                content = get_collated_content(
                                    id_, ident_hash, cursor)
                            if content:
                                result = get_content_metadata(
                                    id, version, cursor)
                                # Build url for canonical link header
                                result['canon_url'] = (
                                        get_canonical_url(result, request))
                                result['content'] = content[:]
                                return result
                            # 302 'cause lack of baked content may be temporary
                            raise httpexceptions.HTTPFound(request.route_path(
                                request.matched_route.name,
                                _query=request.params,
                                ident_hash=join_ident_hash(id, version),
                                ext=routing_args['ext']),
                                headers=[("Cache-Control",
                                          "max-age=60, public")])
                    raise httpexceptions.HTTPNotFound()
            else:
                result = get_content_metadata(id, version, cursor)
                # Build url for canonical link header
                result['canon_url'] = get_canonical_url(result, request)
                # Grab the html content.
                args = dict(id=id, version=result['version'],
                            filename='index.cnxml.html')
                cursor.execute(SQL['get-resource-by-filename'], args)
                try:
                    content = cursor.fetchone()[0]
                except (TypeError, IndexError,):  # None returned
                    logger.debug("module found, but "
                                 "'index.cnxml.html' is missing.")
                    raise httpexceptions.HTTPNotFound()
                result['content'] = content[:]

    return result
177647
public function getBasketArticles()
    {
        if ($this->_oBasketArticles === null) {
            $this->_oBasketArticles = false;

            // passing basket articles
            if ($oBasket = $this->getSession()->getBasket()) {
                $this->_oBasketArticles = $oBasket->getBasketArticles();
            }
        }

        return $this->_oBasketArticles;
    }
20520
def article_parse(self, response, rss_title=None):
        
        if not self.helper.parse_crawler.content_type(response):
            return

        yield self.helper.parse_crawler.pass_to_pipeline_if_article(
            response, self.ignored_allowed_domain, self.original_url,
            rss_title)
580174
def get(self):
        
        url = "{url_base}/resource/{pid}/scimeta/custom/".format(url_base=self.hs.url_base,
                                                                 pid=self.pid)
        r = self.hs._request('GET', url)
        return json.loads(r.text)
1345717
protected Article readArticleFromJson(String json) {
        Gson gson = new Gson();
        Article article = gson.fromJson(json, Article.class);
        return article;
    }
451597
public function getArticles($iStart = null, $iNrofArticles = null, $blReload = false)
    {
        // cached ?
        if ($this->_oArticles !== null && !$blReload) {
            return $this->_oArticles;
        }

        $this->_oArticles = oxNew(\OxidEsales\Eshop\Application\Model\ArticleList::class);

        if ($iStart !== null && $iNrofArticles !== null) {
            $this->_oArticles->setSqlLimit($iStart, $iNrofArticles);
        }

        // loading basket items
        $this->_oArticles->loadRecommArticles($this->getId(), $this->_sArticlesFilter);

        return $this->_oArticles;
    }