def main():
  usage = \
"""%prog [options] <input GTFS.zip>

Create an HTML page of random URLs for the Google Maps transit trip
planner. The queries go between places near stops listed in a <input GTFS.zip>.
By default 50 random URLs are saved to google_random_queries.html.

For more information see
https://github.com/google/transitfeed/wiki/GoogleRandomQueries
"""

  parser = optparse.OptionParser(
      usage=usage,
      version="%prog "+transitfeed.__version__)
  parser.add_option("-l", "--limit", dest="limit", type="int",
                    help="Maximum number of URLs to generate")
  parser.add_option("-o", "--output", dest="output", metavar="HTML_OUTPUT_PATH",
                    help="write HTML output to HTML_OUTPUT_PATH")
  parser.set_defaults(output="google_random_queries.html", limit=50)
  (options, args) = parser.parse_args()
  if len(args) != 1:
    print >>sys.stderr, parser.format_help()
    print >>sys.stderr, "\n\nYou must provide the path of a single feed\n\n"
    sys.exit(2)
  feed_path = args[0]

  # ProblemReporter prints problems on console.
  loader = transitfeed.Loader(feed_path, problems=transitfeed.ProblemReporter(),
                              load_stop_times=False)
  schedule = loader.Load()
  locations = GetRandomLocationsNearStops(schedule)
  random.shuffle(locations)
  agencies = ", ".join([a.agency_name for a in schedule.GetAgencyList()])
  title = "%s (%s)" % (agencies, ParentAndBaseName(feed_path))

  WriteOutput(title,
              locations,
              options.limit,
              open(options.output, "w"))
  print ("Load %s in your web browser. It contains more instructions." %
         options.output)
dataset/ETHPy150Open google/transitfeed/examples/google_random_queries.py/main/original