def _fetchLists(self): """A private convenience function that uses BeautifulSoup (for parsing) and NSString (for authentication) to make combing the HTML code from the main page of lists a bit easier.""" page = NSString.stringWithContentsOfURL_(NSURL.URLWithString_("http://%s.tadalist.com/lists" % (self.username))) soup = BeautifulSoup(page) rawLists = soup.findAll('li') lists = [] for rawList in rawLists: lists.append( TadaList(rawList.a['href'], rawList.a.contents[0], self) ) return lists
def _fetchItems(self, force=True): """Private method that fetches attributes off of the list's page, parses the HTML (with BeautifulSoup), and then creates TadaItems. This is called automatically when a user requests the 'items' of a TadaList.""" page = NSString.stringWithContentsOfURL_(NSURL.URLWithString_(self._url())) soup = BeautifulSoup(page) lis = soup.findAll('li') items = [] for li in lis: items.append(TadaItem(li.form.contents[-1].strip(), li['id'][5:], self)) self.items = items return self.items
def _fetchItems(self, force=True): """Private method that fetches attributes off of the list's page, parses the HTML (with BeautifulSoup), and then creates TadaItems. This is called automatically when a user requests the 'items' of a TadaList.""" page = NSString.stringWithContentsOfURL_( NSURL.URLWithString_(self._url())) soup = BeautifulSoup(page) lis = soup.findAll('li') items = [] for li in lis: items.append( TadaItem(li.form.contents[-1].strip(), li['id'][5:], self)) self.items = items return self.items
def _fetchLists(self): """A private convenience function that uses BeautifulSoup (for parsing) and NSString (for authentication) to make combing the HTML code from the main page of lists a bit easier.""" page = NSString.stringWithContentsOfURL_( NSURL.URLWithString_("http://%s.tadalist.com/lists" % (self.username))) soup = BeautifulSoup(page) rawLists = soup.findAll('li') lists = [] for rawList in rawLists: lists.append( TadaList(rawList.a['href'], rawList.a.contents[0], self)) return lists