viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. import random
  2. import urllib2
  3. import mutex
  4. import threading
  5. import re
  6.  
  7. default_page = "http://poisson.phc.unipi.it/"
  8.  
  9. def get_links(url):
  10. content = get_page(url)
  11. if(content == -1):
  12. return -1
  13.  
  14. links = re.findall(r"<a href=\"(\S*)\">",content)
  15. return links
  16.  
  17. def get_page(url):
  18. try:
  19. req = urllib2.urlopen(url)
  20. except:
  21. return -1
  22.  
  23. return req.read()
  24.  
  25. class Crawler(threading.Thread):
  26.  
  27. def __init__(self, startpage=default_page):
  28. threading.Thread.__init__(self)
  29. start_page = start_page
  30.  
  31.  
  32. def run():
  33.  
  34. # Capiamo che pagina ci serve
  35. page = start_page
  36.  
  37. # Come prima cosa devo fare il parsing dei
  38. # link che ci sono nella pagina
  39.  
  40. links = get_links(page)
  41.  
  42.