Esempio n. 1
0
 def get(self, request, *args, **kwargs):
     # actions.run_spider()
     connection = actions.redis_connection()
     try:
         urls = actions.pull_from_redis(connection, 'urls_tree')
     except:
         urls = None
     start_url = actions.pull_from_redis(connection, 'start_url')
     return render(request, self.template_name, {"urls": urls, 'start_url': start_url})
Esempio n. 2
0
 def send_maze_doors(self, data):
     start_url = data['start_url']
     end_url = data['end_url']
     connection = actions.redis_connection()
     actions.push_to_redis(connection, key_name='start_url', urls=start_url)
     actions.push_to_redis(connection, key_name='end_url', urls=end_url)