Returns a list with posts.
174968
def _parse_posts(element):
    

    posts = []
    items = element.findall("item")

    for item in items:
        title = item.find("./title").text
        link = item.find("./link").text
        pub_date = item.find("./pubDate").text
        creator = item.find("./{%s}creator" % DC_NAMESPACE).text
        guid = item.find("./guid").text
        description = item.find("./description").text
        content = item.find("./{%s}encoded" % CONTENT_NAMESPACE).text
        excerpt = item.find("./{%s}encoded" % EXCERPT_NAMESPACE).text
        post_id = item.find("./{%s}post_id" % WP_NAMESPACE).text
        post_date = item.find("./{%s}post_date" % WP_NAMESPACE).text
        post_date_gmt = item.find("./{%s}post_date_gmt" % WP_NAMESPACE).text
        status = item.find("./{%s}status" % WP_NAMESPACE).text
        post_parent = item.find("./{%s}post_parent" % WP_NAMESPACE).text
        menu_order = item.find("./{%s}menu_order" % WP_NAMESPACE).text
        post_type = item.find("./{%s}post_type" % WP_NAMESPACE).text
        post_name = item.find("./{%s}post_name" % WP_NAMESPACE).text
        is_sticky = item.find("./{%s}is_sticky" % WP_NAMESPACE).text
        ping_status = item.find("./{%s}ping_status" % WP_NAMESPACE).text
        post_password = item.find("./{%s}post_password" % WP_NAMESPACE).text
        category_items = item.findall("./category")

        categories = []
        tags = []

        for category_item in category_items:
            if category_item.attrib["domain"] == "category":
                item_list = categories
            else:
                item_list = tags

            item_list.append(category_item.attrib["nicename"])

        post = {
            "title": title,
            "link": link,
            "pub_date": pub_date,
            "creator": creator,
            "guid": guid,
            "description": description,
            "content": content,
            "excerpt": excerpt,
            "post_id": post_id,
            "post_date": post_date,
            "post_date_gmt": post_date_gmt,
            "status": status,
            "post_parent": post_parent,
            "menu_order": menu_order,
            "post_type": post_type,
            "post_name": post_name,
            "categories": categories,
            "is_sticky": is_sticky,
            "ping_status": ping_status,
            "post_password": post_password,
            "tags": tags,
        }

        post["postmeta"] = _parse_postmeta(item)
        post["comments"] = _parse_comments(item)
        posts.append(post)

    return posts
1148420
function ctc_get_posts() {

		// Base arguments
		$args = array(
			'orderby'         	=> $this->ctc_instance['orderby'],
			'order'           	=> $this->ctc_instance['order'],
			'numberposts'     	=> $this->ctc_instance['limit'],
			'suppress_filters'	=> false // keep WPML from showing posts from all languages: http://bit.ly/I1JIlV + http://bit.ly/1f9GZ7D
		);

		// Group argument
		if ( 'all' != $this->ctc_instance['category'] ) {
			$args['category'] = $this->ctc_instance['category']; // ID
		}

		// Get posts
		$posts = get_posts( $args );

		// Return filtered
		return apply_filters( 'ctc_posts_widget_get_posts', $posts );

	}
1051292
def fetch_additional_posts(self, uid):
        '''
        
        '''
        cats = MPost2Catalog.query_by_entity_uid(uid, kind=self.kind)
        cat_uid_arr = []
        for cat_rec in cats:
            cat_uid = cat_rec.tag_id
            cat_uid_arr.append(cat_uid)
        logger.info('info category: {0}'.format(cat_uid_arr))
        rel_recs = MRelation.get_app_relations(uid, 8, kind=self.kind).objects()

        logger.info('rel_recs count: {0}'.format(rel_recs.count()))
        if cat_uid_arr:
            rand_recs = MPost.query_cat_random(cat_uid_arr[0], limit=4 - rel_recs.count() + 4)
        else:
            rand_recs = MPost.query_random(num=4 - rel_recs.count() + 4, kind=self.kind)
        return rand_recs, rel_recs
596829
def list(cls, params=None):
        
        return fields.ListField(name=cls.ENDPOINT, init_class=cls).decode(
            cls.element_from_string(cls._get_request(params=params).text)
        )
684762
async def post_list(cls, sender, db, instances):
        '''
        
        '''
        serialized_objects = await asyncio.gather(*[obj.serialize() for obj in instances])
        await cls.emit(db, 'resource_get_list', serialized_objects)
290545
def items(self):
        
        return Topic.objects.filter(forum__in=self.forums, approved=True).order_by('-last_post_on')
1229711
public function posts()
    {
        $links[] = [__d('me_cms', 'List posts'), [
            'controller' => 'Posts',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Add post'), [
            'controller' => 'Posts',
            'action' => 'add',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins and managers can access these actions
        if ($this->Auth->isGroup(['admin', 'manager'])) {
            $links[] = [__d('me_cms', 'List categories'), [
                'controller' => 'PostsCategories',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add category'), [
                'controller' => 'PostsCategories',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        $links[] = [__d('me_cms', 'List tags'), [
            'controller' => 'PostsTags',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        return [$links, I18N_POSTS, ['icon' => 'far file-alt']];
    }
560782
def list(self, limit=None, offset=None):
        """"""
        return self._manager.list(limit=limit, offset=offset)
1334325
def recent(self, with_catalog=True, with_date=True):
        '''
        
        '''
        kwd = {
            'pager': '',
            'title': 'Recent posts.',
            'with_catalog': with_catalog,
            'with_date': with_date,
        }
        self.render('list/post_list.html',
                    kwd=kwd,
                    view=MPost.query_recent(num=20),
                    postrecs=MPost.query_recent(num=2),
                    format_date=tools.format_date,
                    userinfo=self.userinfo,
                    cfg=CMS_CFG, )
1318468
def list(self, request, *args, **kwargs):
        """"""
        search_kwargs = {"published": False}

        query_params = get_query_params(self.request)

        for field_name in ("status"):
            if field_name in query_params:
                search_kwargs[field_name] = query_params.get(field_name)

        if "search" in query_params:
            search_kwargs["query"] = query_params.get("search")

        # active/closed are semantics of the Poll model
        # active is analagous to 'published' in Content
        # closed is in relation to the end_date of a Poll
        if "active" in query_params:
            del search_kwargs["published"]
            search_kwargs["active"] = True

        if "closed" in query_params:
            del search_kwargs["published"]
            search_kwargs["closed"] = True

        queryset = self.model.search_objects.search(**search_kwargs)

        page = self.paginate_queryset(queryset)
        if page is not None:
            serializer = self.get_serializer(page, many=True)
            return self.get_paginated_response(serializer.data)

        serializer = self.get_serializer(queryset, many=True)
        return Response(serializer.data)
370288
def index():
    
    context = {'postform': NewPostForm(),
               'pageform': NewPageForm(),
               'delform': DeleteForm()}

    n = request.args.get('all')
    if n is None:
        wants_now = None
    else:
        wants_now = n == '1'

    if wants_now is None and current_user.wants_all_posts:
        wants = True
    else:
        wants = wants_now

    if current_user.can_edit_all_posts and wants:
        posts = site.all_posts
        pages = site.pages
    else:
        wants = False
        posts = []
        pages = []
        for p in site.timeline:
            if (p.meta('author.uid') and
                    p.meta('author.uid') != str(current_user.uid)):
                continue
            if p.is_post:
                posts.append(p)
            else:
                pages.append(p)

    context['posts'] = posts
    context['pages'] = pages
    context['title'] = 'Posts & Pages'
    context['wants'] = wants
    return render('coil_index.tmpl', context)
121279
def retrieve_posts(dir)
      return if outside_configured_directory?(dir)

      site.posts.docs.concat(post_reader.read_posts(dir))
      site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
    end
1324829
def get_reposts(self):
        
        return self._session.fetch_items('wall.getReposts', self.from_json, count=1000, owner_id=self.from_id, post_id=self.id)
872952
public function PaginatedList()
    {
        $allPosts = $this->blogPosts ?: ArrayList::create();
        $posts = PaginatedList::create($allPosts);

        // Set appropriate page size
        if ($this->PostsPerPage > 0) {
            $pageSize = $this->PostsPerPage;
        } elseif ($count = $allPosts->count()) {
            $pageSize = $count;
        } else {
            $pageSize = 99999;
        }
        $posts->setPageLength($pageSize);

        // Set current page
        $start = (int)$this->request->getVar($posts->getPaginationGetVar());
        $posts->setPageStart($start);

        return $posts;
    }
1398
def data(self):
        """"""
        import warnings
        warnings.warn(
            '`data` attribute is deprecated and will be removed in a future release, '
            'use %s as an iterable instead' % (PaginatedResponse,),
            category=DeprecationWarning,
            stacklevel=2  # log wherever '.data' is referenced, rather than this line
        )
        return list(self)
367088
function(tag) {
    var posts = [];
    for (var key in this.posts) {
      if (this.posts[key].tags && this.posts[key].tags.indexOf(tag) !== -1) {
        posts.push(this.posts[key]);
      }
    }
    return posts;
  }
1059008
protected function getNewPosts()
    {
        Container::get('hooks')->fire('model.index.get_new_posts_start');

        $query['select'] = ['f.id', 'f.last_post'];
        $query['where'] = [
            ['fp.read_forum' => 'IS NULL'],
            ['fp.read_forum' => '1']
        ];
        $query = DB::forTable('forums')
            ->table_alias('f')
            ->select_many($query['select'])
            ->left_outer_join(
                DB::prefix().'forum_perms',
                '(`fp`.`forum_id`=`f`.`id` AND `fp`.`group_id`='.User::get()->g_id.')',
                'fp'
            )
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.forum_id', '=', 'f.id'), 'fp')
//            ->left_outer_join(DB::prefix().'forum_perms', array('fp.group_id', '=',
// User::get()->g_id), null, true)
//            ->where_any_is($query['where'])
            ->where_raw('(fp.read_forum IS NULL OR fp.read_forum = 1)')
            ->where_gt('f.last_post', User::get()->last_visit);

        $query = Container::get('hooks')->fireDB('model.index.query_get_new_posts', $query);

        $query = $query->find_result_set();

        $forums = $new_topics = [];
        $tracked_topics = Track::getTrackedTopics();

        foreach ($query as $cur_forum) {
            if (!isset($tracked_topics['forums'][$cur_forum->id]) ||
                $tracked_topics['forums'][$cur_forum->id] < $cur_forum->last_post) {
                $forums[$cur_forum->id] = $cur_forum->last_post;
            }
        }

        if (!empty($forums)) {
            if (empty($tracked_topics['topics'])) {
                $new_topics = $forums;
            } else {
                $query['select'] = ['forum_id', 'id', 'last_post'];

                $query = DB::forTable('topics')
                    ->select_many($query['select'])
                    ->where_in('forum_id', array_keys($forums))
                    ->where_gt('last_post', User::get()->last_visit)
                    ->where_null('moved_to');

                $query = Container::get('hooks')->fireDB('model.index.get_new_posts_query', $query);

                $query = $query->find_result_set();

                foreach ($query as $cur_topic) {
                    if (!isset($new_topics[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['forums'][$cur_topic->forum_id]) ||
                            $tracked_topics['forums'][$cur_topic->forum_id] < $forums[$cur_topic->forum_id]) &&
                        (!isset($tracked_topics['topics'][$cur_topic->id]) ||
                            $tracked_topics['topics'][$cur_topic->id] < $cur_topic->last_post)) {
                        $new_topics[$cur_topic->forum_id] = $forums[$cur_topic->forum_id];
                    }
                }
            }
        }

        $new_topics = Container::get('hooks')->fire('model.index.get_new_posts', $new_topics);

        return $new_topics;
    }