This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import scrapy | |
class OlxSpider(scrapy.Spider): | |
name = "olx" | |
allowed_domains = ["pe.olx.com.br"] | |
start_urls = ( | |
'http://pe.olx.com.br/imoveis/aluguel', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import scrapy | |
class OlxSpider(scrapy.Spider): | |
name = "olx" | |
allowed_domains = ["pe.olx.com.br"] | |
start_urls = ( | |
'http://pe.olx.com.br/imoveis/aluguel', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import scrapy | |
class OlxSpider(scrapy.Spider): | |
name = "olx" | |
allowed_domains = ["pe.olx.com.br"] | |
start_urls = ( | |
'http://pe.olx.com.br/imoveis/aluguel', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import scrapy | |
class OlxSpider(scrapy.Spider): | |
name = "olx" | |
allowed_domains = ["pe.olx.com.br"] | |
start_urls = ( | |
'http://pe.olx.com.br/imoveis/aluguel', | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import rethinkdb as r | |
class RethinkdbPipeline(object): | |
conn = None | |
rethinkdb_settings = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
from django.http import Http404 | |
class MeuMiddleware(object): | |
def process_request(self, request): | |
if request.META["REMOTE_ADDR"] in settings.IPS_PERMITIDOS: | |
pass | |
else: | |
raise Http404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def minha_view(request): | |
marca = request.GET.get("marca", "") | |
if marcar: | |
context["brands_list"] = Post.objects.filter(is_active=True, brands__exact='MARCA01').order_by('created_date') | |
else: | |
context["brands_list"] = Post.objects.filter(is_active=True).order_by('created_date') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
import os | |
DEBUG = True | |
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
DATABASES = { | |
'default': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#deb cdrom:[LE 5.0 _le5/escola_ - Release i386 (20130421)]/ precise main restricted | |
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
# newer versions of the distribution. | |
deb http://br.archive.ubuntu.com/ubuntu/ precise main restricted | |
deb-src http://br.archive.ubuntu.com/ubuntu/ precise main restricted | |
## Major bug fix updates produced after the final release of the | |
## distribution. | |
deb http://br.archive.ubuntu.com/ubuntu/ precise-updates main restricted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
numero = random.randint(1, 100) | |
contador = 0 | |
while contador < 5: | |
print("Tentativa de número: ", contador) | |
chute = input("Digite um chute: ") |