bash/python question

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

  1. lynkynpark86
    Expand Collapse
    macrumors 6502

    #1
    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. willieva
    Expand Collapse
    macrumors 6502

    Joined:
    Mar 12, 2010
    #2
    In a terminal, type:
    curl url
    where url is the url of the website.
     
  3. larkost
    Expand Collapse
    macrumors 6502a

    Joined:
    Oct 13, 2007
    #3
    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