bash/python question

Discussion in 'Mac Programming' started by lynkynpark86, Jun 7, 2011.

  1. macrumors 6502

    There is a website that has the number of downloads of a file on it, and I want to create a command to return, through echo or print, the number of downloads. How might I go about doing this?
    When I view the source of the website, it only shows the number itself, not a data source or anything.
  2. macrumors 6502

    Mar 12, 2010
    In a terminal, type:
    curl url
    where url is the url of the website.
  3. macrumors 6502a

    Oct 13, 2007
    You would need to write something that took in the html of the website, stripped out the information you are looking for (possibly doing more than just paring for urls), and then returns that as a list.

    Python and the urllib2 class would probably be how I would start this.

Share This Page