@@ -0,0 +1,1125 @@
+%22%22%22Fetch Port Authority of Allegheny County (Pittsburgh) feed.%22%22%22%0Afrom datetime import datetime%0Aimport logging%0A%0Afrom bs4 import BeautifulSoup%0Aimport requests%0A%0Afrom FeedSource import FeedSource, TIMECHECK_FMT%0A%0AURL = 'http://www.portauthority.org/GeneralTransitFeed/'%0AFILE_NAME = 'paac.zip'%0A%0ALOG = logging.getLogger(__name__)%0A%0A%0Aclass Paac(FeedSource):%0A    %22%22%22Fetch Pittsburgh feed.%22%22%22%0A    def __init__(self):%0A        super(Paac, self).__init__()%0A        # Go scrape the directory listing to find out what download file name is%0A        response = requests.get(URL)%0A        if response.ok:%0A            soup = BeautifulSoup(response.text)%0A            # go find the zip file link%0A            anchors = soup.findAll('a')%0A            for anchor in anchors:%0A                if anchor.text.endswith('.zip'):%0A                    LOG.debug('Found PAAC download file named %25s', anchor.text)%0A                    self.urls = %7BFILE_NAME: URL + anchor.text%7D%0A            if not self.urls:%0A                LOG.error('Could not parse directory listing for PAAC.')%0A        else:%0A            LOG.error('Could not get directory listing for PAAC.')%0A

Add Pittsburgh (PAAC)