Setup feed items.
6551
private function setup_feeds() {
		if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {
			// Load SimplePie Instance.
			$feed = fetch_feed( $this->feeds );
			// TODO report error when is an error loading the feed.
			if ( is_wp_error( $feed ) ) {
				return;
			}

			$items = $feed->get_items( 0, 5 );
			foreach ( (array) $items as $item ) {
				$items_normalized[] = array(
					'title' => $item->get_title(),
					'date'  => $item->get_date( 'U' ),
					'link'  => $item->get_permalink(),
				);
			}
			set_transient( 'themeisle_sdk_feed_items', $items_normalized, 48 * HOUR_IN_SECONDS );
		}
		$this->items = $items_normalized;
	}
1097149
public void setup(float pitch, float gain) {
		AL10.alSourcef(source, AL10.AL_PITCH, pitch);
		AL10.alSourcef(source, AL10.AL_GAIN, gain); 
	}
833513
def populate_items(self, request):
        ''''''
        self._items = self.get_items(request)
        return self.items
1033926
def setup(only: nil, except: nil)
      items = instance_methods.map(&:to_s) - %w[setup]
      items -= Array.wrap(except).map(&:to_s) if except
      if only
        only = Array.wrap(only).map(&:to_s)
        items &= only
        items += only
      end
      items.uniq.each { |item| public_send(item) }
    end
352158
protected function set_items() {
		$home_label = $this->get_home_label();

		if ( is_front_page() ) {
			$this->set( $home_label );
		} else {
			$this->set( $home_label, home_url() );
		}
	}
728950
def GetFeedItems(client, feed):
  
  feed_item_service = client.GetService('FeedItemService', 'v201809')

  feed_items = []
  more_pages = True

  selector = {
      'fields': ['FeedItemId', 'AttributeValues'],
      'predicates': [
          {
              'field': 'Status',
              'operator': 'EQUALS',
              'values': ['ENABLED']
          },
          {
              'field': 'FeedId',
              'operator': 'EQUALS',
              'values': [feed['id']]
          }
      ],
      'paging': {
          'startIndex': 0,
          'numberResults': PAGE_SIZE
      }
  }

  while more_pages:
    page = feed_item_service.get(selector)

    if 'entries' in page:
      feed_items.extend(page['entries'])

    selector['paging']['startIndex'] += PAGE_SIZE
    more_pages = selector['paging']['startIndex'] < int(page['totalNumEntries'])

  return feed_items
846209
protected function set_items() {
		$post_type = $this->get_post_type();
		if ( ! $post_type || 'post' === $post_type ) {
			return;
		}

		$this->set( $this->get_the_archive_title() );
	}
1166406
protected function setUp()
	{
		$this->collection = new EmoticonCollection;

		if (!$this->configurator->tags->exists($this->tagName))
		{
			$this->configurator->tags->add($this->tagName);
		}
	}
659387
def __setup_menu(self):
        """"""
        self.menu.clear()
        if self.data:
            actions = self.menu_actions
        else:
            actions = (self.new_action, self.open_action)
            self.setFocus() # --> Editor.__get_focus_editortabwidget
        add_actions(self.menu, list(actions) + self.__get_split_actions())
        self.close_action.setEnabled(self.is_closable)
1259918
protected function registerFeed()
    {
        $this->app->singleton(FeedContract::class, function ($app) {
            $cache = $app['cache.store'];

            return new Feed($cache);
        });
    }
1081617
def setup(self):
        """"""
        if self.dry_run is not True:
            self.client = self._get_client()
            self._disable_access_key()
742666
def feed(self, contents):
        '''
            
        '''
        contents = stripIEConditionals(contents)
        try:
            HTMLParser.feed(self, contents)
        except MultipleRootNodeException:
            self.reset()
            HTMLParser.feed(self, "%s%s" %(addStartTag(contents, INVISIBLE_ROOT_TAG_START), INVISIBLE_ROOT_TAG_END))
451676
def set_items(self, items):
        
        self._pending_view_refreshes +=1
        timed_call(self._pending_timeout, self._refresh_layout)
906239
public function feed()
    {
        if (isset($_POST[$this->name]) && is_array($_POST[$this->name])) {
            $this->setValue(array_values($_POST[$this->name]));
        }
    }
1008163
def in_feed(self, feed):
        ''''''
        kwargs = {self.model._rel_to_feed: feed}
        return self.filter(**kwargs)
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);
        
    }
819425
def main():
    """"""
    global config
    parser = OptionParser(version='%prog v' + __version__)
    parser.add_option('-c', '--config', default='config.ini',
                      help='Location of config file (default: %default)',
                      metavar='FILE')
    parser.add_option('-a', '--all', action='store_true', default=False,
                      dest='all',
                      help='Send all RSS items as tweet')
    parser.add_option('-l', '--limit', dest='limit',
                      default=10,
                      help='Use with all parameters, send the first 10 feeds as a tweet')
    (options, args) = parser.parse_args()
    config = SafeConfigParser()
    if not config.read(options.config):
        print 'Could not read config file'
        sys.exit(1)
    rss_uri = config.get('rss', 'uri')
    feed = feedparser.parse(rss_uri)
    # lots of scary warnings about possible security risk using this method
    # but for local use I'd rather do this than a try-catch with open()
    if not os.path.isfile('cache.dat'):
        # make a blank cache file
        cPickle.dump({'id': None}, open('cache.dat', 'wb'), -1)

    cache = cPickle.load(open('cache.dat'))
    if options.all:
        tweet_count = 0
        for entry in feed['entries']:
            rss = {
                'id': entry['id'],
                'link': entry['link'],
                'title': entry['title'],
                'summary': entry['summary'],
                'hashtag': ' '.join(['#%s' % i for i in entry['tags'][0]['term'].split()[:2]]),
            }
            post_update('%s %s %s' % (rss['title'], rss['link'], rss['hashtag']))

            # We keep the first feed in the cache, to use rss2twitter in normal mode the next time
            if tweet_count == 0:
                cPickle.dump(rss, open('cache.dat', 'wb'), -1)

            tweet_count += 1
            if tweet_count >= options.limit:
                break
    else:
        rss = {
            'id': feed['entries'][0]['id'],
            'link': feed['entries'][0]['link'],
            'title': feed['entries'][0]['title'],
            'summary': feed['entries'][0]['summary'],
            'hashtag': ' '.join(['#%s' % i for i in feed['entries'][0]['tags'][0]['term'].split()[:2]]),
        }
        # compare with cache
        if cache['id'] != rss['id']:
            #print 'new post'
            post_update('%s %s %s' % (rss['title'], rss['link'], rss['hashtag']))
            cPickle.dump(rss, open('cache.dat', 'wb'), -1)