Automatically migrated from Gitolite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
696 B

9 years ago
  1. #!/usr/bin/python
  2. import urllib, re
  3. def get_category_listings(url):
  4. contents = urllib.urlopen(url).read()
  5. matches = re.findall('<a href="(http:\/\/www\.webshots\.com\/members\/[^/]+\/[^/]+\.html)">top members</a>', contents)
  6. return matches
  7. def get_user_listings(url):
  8. contents = urllib.urlopen(url).read()
  9. matches = re.findall('<a href="(http:\/\/www\.webshots\.com\/members\/[^/]+\/[^/]+\.html)">[0-9]+-[0-9]+</a>', contents)
  10. if len(matches) > 0:
  11. matches.pop(0)
  12. return matches
  13. def get_users(url):
  14. contents = urllib.urlopen(url).read()
  15. matches = re.findall('http:\/\/community\.webshots\.com\/user\/([^/\'"]+)', contents)
  16. return [value for value in matches if value != "my"]