From 20bf8d1bba70f4b062700073850ba3afb343b899 Mon Sep 17 00:00:00 2001 From: Henrique Lopes Date: Tue, 27 May 2014 00:34:26 -0300 Subject: [PATCH 1/5] Add support the test. --- .gitignore | 1 + PyOpenGraph/PyOpenGraph.py | 4 +- PyOpenGraph/test/PyOpenGraphTest.py | 20 + PyOpenGraph/test/__init__.py | 0 PyOpenGraph/test/contents/booking.html | 9585 ++++++++++++++++++++ PyOpenGraph/test/contents/hotelurbano.html | 307 + 6 files changed, 9915 insertions(+), 2 deletions(-) create mode 100644 PyOpenGraph/test/PyOpenGraphTest.py create mode 100644 PyOpenGraph/test/__init__.py create mode 100644 PyOpenGraph/test/contents/booking.html create mode 100644 PyOpenGraph/test/contents/hotelurbano.html diff --git a/.gitignore b/.gitignore index a2ece16..045b40f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc *.pyo dist/* +requirements.txt diff --git a/PyOpenGraph/PyOpenGraph.py b/PyOpenGraph/PyOpenGraph.py index 9f27468..e10add6 100644 --- a/PyOpenGraph/PyOpenGraph.py +++ b/PyOpenGraph/PyOpenGraph.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- +#coding: utf-8 #Copyright (c) 2010 Gerson Minichiello # @@ -54,4 +54,4 @@ def __str__(self): if __name__ == '__main__': # Usage og = PyOpenGraph('http://www.zappos.com/timberland-pro-titan-safety-toe-oxford') - print og.metadata + print og.metadata \ No newline at end of file diff --git a/PyOpenGraph/test/PyOpenGraphTest.py b/PyOpenGraph/test/PyOpenGraphTest.py new file mode 100644 index 0000000..6e0f54d --- /dev/null +++ b/PyOpenGraph/test/PyOpenGraphTest.py @@ -0,0 +1,20 @@ +#conding: utf-8 +import unitest +from nose.tools import * + +class MockUrlLib(object): + + def __init__(self, _file, _type='html', code=200, msg='OK', headers={'content-type': 'text/plain; charset=utf-8'}): + self.file_test = ("%s.%s" % (_file, _type)) + self.code = code + self.msg = msg + self.headers = headers + + def read(self): + handle = open(self.file_test) + html = "".join( handle ) + return html + + +class PyOpenGraph(unitest.TestCase): + pass \ No newline at end of file diff --git a/PyOpenGraph/test/__init__.py b/PyOpenGraph/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PyOpenGraph/test/contents/booking.html b/PyOpenGraph/test/contents/booking.html new file mode 100644 index 0000000..fbcf3c6 --- /dev/null +++ b/PyOpenGraph/test/contents/booking.html @@ -0,0 +1,9585 @@ + + + + + + +Plus Sol Ipanema Hotel, Rio de Janeiro, Brazil - 533 Guest reviews. Book your hotel now! - Booking.com + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + +
+
+
+ + + +
+ + + +
+ + + + + + + + + +
+
+ +

Saved to 298 lists

+
+

You added this to

+ +
+
+
+
+ +

+Property highlights +

+ + + + + +Free WiFi + + +

Popular district:

+ + + +Ipanema + + +

Popular facilities:

+ + + +Outdoor pool + + +

Highly rated for:

+ + + +Seaside + + +

Places of interest:

+Ipanema Beach +(400m) + +Post 9 - Ipanema +(100m) + +
+
+
+ +
+
+

See more properties

+ + + + + + + + + + +
+ +

+ + + + + +
+ +
+
+
+
+
+
+

+Check-in date +

+ + + + +
+
+

+Check-out date +

+ + + + +
+
+
+
+ + +
+ +
Duration
+ +
+
+ +
Month
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+ +
+ +
+ +
+Show map + +Best Western Plus Sol Ipanema Hotel + + + + + + +
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+

+Customers who viewed Best Western Plus Sol Ipanema Hotel also viewed: +

+ + + + + + + +
+

+Caesar Park Ipanema + +

+ +hotel + +The 5-star Caesar Park Rio de Janeiro Ipanema welcomes you in a luxurious building situated on the seafront of Ipanema Beach, one of the most privileged areas of Rio de Janeiro. +
+

+Most recent booking for this property was today at 08:29 +

+
+ + +Score from 419 reviews + + +Very good + - 8.2/10 + + +
+
+Total price from: + +R$ 714 + +
+ +
+

+Atlantis Copacabana Hotel + +

+ +hotel + +With its prime location, Atlantis Copacabana Hotel is just a 5-minute walk to both Copacabana and Ipanema Beaches. It provides a terrace with Atlantic Ocean views and a rooftop pool. +
+

+Most recent booking for this property was today at 08:21 +

+
+ + +Score from 1535 reviews + + +Good + - 7.9/10 + + +
+
+Total price from: + +R$ 330 + +
+ +
+

+Marina Palace Hotel + +

+ +hotel + +Located opposite Leblon Beach, the Marina Palace hotel features a rooftop swimming pool and a poolside bar. +
+

+Most recent booking for this property was yesterday at 22:55 +

+
+ + +Score from 388 reviews + + +Good + - 7.6/10 + + +
+
+Total price from: + +R$ 550 + +
+ +
+

+Pestana Rio Atlantica + +

+ +hotel + +Situated on Copacabana´s stunning beachfront, Pestana Rio Atlantica offers modern, luxurious suites and various leisure and gastronomic options. +
+

+Most recent booking for this property was today at 02:49 +

+
+ + +Score from 463 reviews + + +Good + - 7.7/10 + + +
+
+Total price from: + +R$ 587.84 + +
+ +
+

View more hotels in Rio de Janeiro +

+
+
+ +
+ + + + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+Close map +
+
+ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/PyOpenGraph/test/contents/hotelurbano.html b/PyOpenGraph/test/contents/hotelurbano.html new file mode 100644 index 0000000..33b864d --- /dev/null +++ b/PyOpenGraph/test/contents/hotelurbano.html @@ -0,0 +1,307 @@ +Pacote: Meliá Angra, Angra dos Reis, R$ 420 | Hotel Urbano
+ + + +
+ +
+ + + + + + + Fechar Busca + + + + Abrir Busca + +
+
+ + +

Meliá Angra

Angra dos Reis, RJ

Resort na Praia + Grátis p/ Criança até 12 Anos*

Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ

Incluso no pacote

  • Academia

  • Apartamento

  • All inclusive

  • Área de lazer

  • Cofre

  • Estacionamento

  • Internet wireless

  • Piscina

  • Sauna

  • Camareira

  • Grátis para criança

Outras opções deste pacote

  • A: 1 Diária Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$420

  • B: 2 Diárias Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$850

  • C: 2 Diárias em Fins de Semana

    Entrada (check-in) Sexta-Feira e Saída (check-out) Domingo

    Por apenas

    R$929

  • D: 3 Diárias Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$1.259

  • E: 3 Diárias em Fins de Semana

    Entrada (check-in) a partir de Quinta-Feira e Saída (check-out) até Segunda-Feira

    Por apenas

    R$1.365

+

O que saber sobre este pacote

+
    +
  • +

    Validade

    +

    + De 14 de abril a 30 de setembro de 2014, para todos os dias da semana, inclusive fins de semana, de acordo com a opção escolhida no momento da compra, exceto semanas de feriados e eventos na região

    +

    +
  • +
  • +

    Política de Reservas

    +

      +
    1. +  A reserva deverá ser feita diretamente com o estabelecimento, até 14 dias antes da data desejada para entrada (check-in), mediante disponibilidade, pelos telefones (24) 3421-1115 | (24) 3421-1131 | (24) 3421-1103 | (24) 3421-1123 | (24) 3421-1121, de segunda à sexta, das 10h às 18h, ou pelos e-mails supreservas.angra@meliahotels.com.br | reservas2.angra@meliahotels.com.br, informando o período desejado para estada, os nomes dos hóspedes, as datas de nascimento, RG, CPF, e-mail e telefone para contato
    2. +
    3. + Após a confirmação de disponibilidade da data desejada, informe o código para reserva ao estabelecimento
    4. +
    +

    +
  • +
  • +

    Política de Reagendamento/Cancelamento

    +

    + Alterações na reserva poderão ser feitas até 20 dias antes da data agendada para a entrada (check-in), mediante disponibilidade. Será permitida apenas uma remarcação

    +

    +
  • +
  • +

    Crianças e Camas Extras :

    +

    *Gratuidade para 1 criança de até 12 anos, hospedada na mesma acomodação do responsáveis

    +

  • +
  • +

    Internet :

    +

    Wi-Fi Grátis

    +
  • +
  • +

    Políticas do Estabelecimento

    +

    Check in: 15:00

    +

    Check out: 12:00

    +
  • +
  • +

    Outras Informações

    +

      +
    1. + O pacote inlcui sistema All Inclusive de alimentação com comidas e bebidas alcoólicas e não alcoólicas, à vontade até às 23h, dentro dos horários pré-estabelecidos
    2. +
    3. + Capacidade máxima na acomodação: 2 adultos e 1 criança de até 12 anos
    4. +
    5. + Política para hospedagem de menores: crianças menores de 18 anos, acompanhados dos responsáveis, deverão apresentar na entrada (check-in) documento com foto, que comprove identidade e filiação/guarda. Crianças menores de 18 anos sem a companhia dos responsáveis,  deverão apresentar na entrada (check-in) documento de autorização de hospedagem, assinado por um dos pais ou responsável legal, com firma reconhecida em cartório
    6. +
    +

    +
  • +
  • +

    Estacionamento :

    +

    Grátis

    +
  • + +
  • +

    Taxas

    +

    + Valores referentes a impostos e taxas administrativas já estão incluídos no momento da finalização da compra, no site do Hotel Urbano (não sendo necessário, após a finalização da compra, o pagamento de nenhum tipo de taxa)

    +

    +
  • +
  • +

    Tipo de Acomodação

    +

    Apartamento Superior com vista para o jardim, duas camas queen size ou uma king, e sofá cama

    +
  • +
  • +

    Localização

    + + +

    Endereço: Rodovia Rio Santos, Km 488 - CEP: 23942300 - Pontal - Angra dos Reis - RJ - BR

    +
  • +
  • +

    Nome Empresarial: Meliá Angra

    +

    CNPJ ou CPF : 62413877003853

    +

    Endereço: Rodovia Rio Santos (BR-101), 488 - CEP: 23942300 - Pontal - Angra dos Reis - RJ - BR

    + + +

    Web site: http://pt.melia.com/hoteis/brasil/angra-dos-reis/melia-angra-marina-and-convention-resort/home.htm

    +
  • +
+
+
  • Diarias

    1

    diária

  • Pessoas

    2

    Pessoas

Mais procurada da semana

Só restam 4 pacotes a esse preço.

De: R$ 699

R$420

6 x de R$ 70,00 sem juros

40% Off

Leva apenas 2 minutos

+
+ + From cd96abe94961cf0026e08232332cb6b4046fe9aa Mon Sep 17 00:00:00 2001 From: Henrique Lopes Date: Wed, 28 May 2014 00:00:07 -0300 Subject: [PATCH 2/5] Adding the new tests for app. --- PyOpenGraph/PyOpenGraph.py | 17 +- PyOpenGraph/test/PyOpenGraphTest.py | 57 +- PyOpenGraph/test/contents/booking.html | 9585 -------------------- PyOpenGraph/test/contents/booking.json | 133 + PyOpenGraph/test/contents/hotelurbano.html | 307 - PyOpenGraph/test/contents/hotelurbano.json | 21 + PyOpenGraph/test/contents/zappos.json | 33 + 7 files changed, 244 insertions(+), 9909 deletions(-) delete mode 100644 PyOpenGraph/test/contents/booking.html create mode 100644 PyOpenGraph/test/contents/booking.json delete mode 100644 PyOpenGraph/test/contents/hotelurbano.html create mode 100644 PyOpenGraph/test/contents/hotelurbano.json create mode 100644 PyOpenGraph/test/contents/zappos.json diff --git a/PyOpenGraph/PyOpenGraph.py b/PyOpenGraph/PyOpenGraph.py index e10add6..de444dc 100644 --- a/PyOpenGraph/PyOpenGraph.py +++ b/PyOpenGraph/PyOpenGraph.py @@ -30,8 +30,9 @@ ] class PyOpenGraph(object): - + def __init__(self, url=None, xml=None): + self.url = url parser = rdfadict.RdfaParser() if not xml: result = parser.parse_url(url) @@ -46,12 +47,8 @@ def get_properties(self, data): for ns in OPENGRAPH_NAMESPACES: if k.startswith(ns) and len(v)>0: content[k.replace(ns, '')] = v[0] - return content - - def __str__(self): - return self.metadata['title'] - -if __name__ == '__main__': - # Usage - og = PyOpenGraph('http://www.zappos.com/timberland-pro-titan-safety-toe-oxford') - print og.metadata \ No newline at end of file + return self._reprocess_content(content) + + def _reprocess_content(self, content): + if len(content): + return content diff --git a/PyOpenGraph/test/PyOpenGraphTest.py b/PyOpenGraph/test/PyOpenGraphTest.py index 6e0f54d..0118c89 100644 --- a/PyOpenGraph/test/PyOpenGraphTest.py +++ b/PyOpenGraph/test/PyOpenGraphTest.py @@ -1,20 +1,63 @@ -#conding: utf-8 -import unitest +#coding: utf-8 +import unittest +from mock import patch from nose.tools import * - -class MockUrlLib(object): +from PyOpenGraph import PyOpenGraph as o + +class MockResponse(object): def __init__(self, _file, _type='html', code=200, msg='OK', headers={'content-type': 'text/plain; charset=utf-8'}): self.file_test = ("%s.%s" % (_file, _type)) + self._type = _type self.code = code self.msg = msg self.headers = headers - def read(self): + def parse_url(self, *arg): handle = open(self.file_test) html = "".join( handle ) + if self._type == 'json': + import json + return json.loads(html) return html + + def parse_string(self, *arg): + pass -class PyOpenGraph(unitest.TestCase): - pass \ No newline at end of file +class PyOpenGraph(unittest.TestCase): + + @patch('PyOpenGraph.PyOpenGraph.rdfadict.RdfaParser') + def test_for_zappos_web_site_the_lib_should_be_load_og_metas(self, p): + """ + For the zappos web site, the lib should be load og metas. + """ + p.return_value = MockResponse('contents/zappos', _type='json', headers={'content-type': 'text/javascript; charset=utf-8'}) + og = o.PyOpenGraph('http://www.zappos.com/timberland-pro-titan-safety-toe-oxford') + assert_equals(og.metadata['title'], u'Timberland PRO TiTAN® Safety Toe Oxford') + assert_equals(og.metadata['url'], 'http://www.zappos.com/timberland-pro-titan-safety-toe-oxford') + assert_equals(og.metadata['type'], 'product') + assert_equals(og.metadata['site_name'], 'Zappos.com') + + @patch('PyOpenGraph.PyOpenGraph.rdfadict.RdfaParser') + def test_for_booking_web_site_the_lib_should_be_load_og_metas(self, p): + """ + For the booking web site, the lib should be load og metas. + """ + p.return_value = MockResponse('contents/booking', _type='json', headers={'content-type': 'text/javascript; charset=utf-8'}) + og = o.PyOpenGraph('http://www.booking.com/hotel/br/best-western-sol-ipanema.pt-br.html') + assert_equals(og.metadata['title'], 'Best Western Plus Sol Ipanema Hotel, Rio de Janeiro, BR') + assert_equals(og.metadata['url'], 'http://www.booking.com/hotel/br/best-western-sol-ipanema.pt-br.html') + assert_equals(og.metadata['type'], 'booking_com:hotel') + assert_equals(og.metadata['site_name'], 'Booking.com') + + @patch('PyOpenGraph.PyOpenGraph.rdfadict.RdfaParser') + def test_case_player_does_n_use_prefix_og_at_head_the_lib_should_be_process_with_beaut_soap(self, p): + """ + Case player does'n use prefix og at head, the lib should be process with beautiful soup. + """ + og = o.PyOpenGraph('http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795') + assert_equals(og.metadata['title'], 'Angra dos Reis, Meliá Angra, 7x de R$ 60,00') + assert_equals(og.metadata['type'], 'website') + assert_equals(og.metadata['site_name'], 'hotelurbano.com') + assert_equals(og.metadata['url'], 'http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795?cmp=895') \ No newline at end of file diff --git a/PyOpenGraph/test/contents/booking.html b/PyOpenGraph/test/contents/booking.html deleted file mode 100644 index fbcf3c6..0000000 --- a/PyOpenGraph/test/contents/booking.html +++ /dev/null @@ -1,9585 +0,0 @@ - - - - - - -Plus Sol Ipanema Hotel, Rio de Janeiro, Brazil - 533 Guest reviews. Book your hotel now! - Booking.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - - - - - - -
-
-
- - - -
- - - -
- - - - - - - - - -
-
- -

Saved to 298 lists

-
-

You added this to

- -
-
-
-
- -

-Property highlights -

- - - - - -Free WiFi - - -

Popular district:

- - - -Ipanema - - -

Popular facilities:

- - - -Outdoor pool - - -

Highly rated for:

- - - -Seaside - - -

Places of interest:

-Ipanema Beach -(400m) - -Post 9 - Ipanema -(100m) - -
-
-
- -
-
-

See more properties

- - - - - - - - - - -
- -

- - - - - -
- -
-
-
-
-
-
-

-Check-in date -

- - - - -
-
-

-Check-out date -

- - - - -
-
-
-
- - -
- -
Duration
- -
-
- -
Month
- -
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
-
-
- -
-
- -
-
- -
-
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
- -
- -
- -
-Show map - -Best Western Plus Sol Ipanema Hotel - - - - - - -
-
- - -
-
-
-
- - -
-
-
-
- -
-
-
-

-Customers who viewed Best Western Plus Sol Ipanema Hotel also viewed: -

- - - - - - - -
-

-Caesar Park Ipanema - -

- -hotel - -The 5-star Caesar Park Rio de Janeiro Ipanema welcomes you in a luxurious building situated on the seafront of Ipanema Beach, one of the most privileged areas of Rio de Janeiro. -
-

-Most recent booking for this property was today at 08:29 -

-
- - -Score from 419 reviews - - -Very good - - 8.2/10 - - -
-
-Total price from: - -R$ 714 - -
- -
-

-Atlantis Copacabana Hotel - -

- -hotel - -With its prime location, Atlantis Copacabana Hotel is just a 5-minute walk to both Copacabana and Ipanema Beaches. It provides a terrace with Atlantic Ocean views and a rooftop pool. -
-

-Most recent booking for this property was today at 08:21 -

-
- - -Score from 1535 reviews - - -Good - - 7.9/10 - - -
-
-Total price from: - -R$ 330 - -
- -
-

-Marina Palace Hotel - -

- -hotel - -Located opposite Leblon Beach, the Marina Palace hotel features a rooftop swimming pool and a poolside bar. -
-

-Most recent booking for this property was yesterday at 22:55 -

-
- - -Score from 388 reviews - - -Good - - 7.6/10 - - -
-
-Total price from: - -R$ 550 - -
- -
-

-Pestana Rio Atlantica - -

- -hotel - -Situated on Copacabana´s stunning beachfront, Pestana Rio Atlantica offers modern, luxurious suites and various leisure and gastronomic options. -
-

-Most recent booking for this property was today at 02:49 -

-
- - -Score from 463 reviews - - -Good - - 7.7/10 - - -
-
-Total price from: - -R$ 587.84 - -
- -
-

View more hotels in Rio de Janeiro -

-
-
- -
- - - - -
- - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
-
-
-
-
-Close map -
-
- - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PyOpenGraph/test/contents/booking.json b/PyOpenGraph/test/contents/booking.json new file mode 100644 index 0000000..8122baa --- /dev/null +++ b/PyOpenGraph/test/contents/booking.json @@ -0,0 +1,133 @@ +{ + "umhpppVR28": { + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://rdf.data-vocabulary.org/#Breadcrumb" + ] + }, + "umhpppVR26": { + "http://rdf.data-vocabulary.org/#title": [ + "Rio de Janeiro" + ], + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://rdf.data-vocabulary.org/#Breadcrumb" + ], + "http://rdf.data-vocabulary.org/#url": [ + "http://www.booking.com/city/br/rio-de-janeiro.pt-br.html" + ] + }, + "umhpppVR27": { + "http://rdf.data-vocabulary.org/#title": [ + "Ipanema" + ], + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://rdf.data-vocabulary.org/#Breadcrumb" + ], + "http://rdf.data-vocabulary.org/#url": [ + "http://www.booking.com/district/br/rio-de-janeiro/ipanema.pt-br.html" + ] + }, + "umhpppVR24": { + "http://rdf.data-vocabulary.org/#title": [ + "BR" + ], + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://rdf.data-vocabulary.org/#Breadcrumb" + ], + "http://rdf.data-vocabulary.org/#url": [ + "http://www.booking.com/country/br.pt-br.html" + ] + }, + "umhpppVR25": { + "http://rdf.data-vocabulary.org/#title": [ + "Rio de Janeiro" + ], + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://rdf.data-vocabulary.org/#Breadcrumb" + ], + "http://rdf.data-vocabulary.org/#url": [ + "http://www.booking.com/region/br/rio-de-janeiro.pt-br.html" + ] + }, + "umhpppVR23": { + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [ + "http://rdf.data-vocabulary.org/#Breadcrumb" + ] + }, + "http://www.booking.com/hotel/br/best-western-sol-ipanema.pt-br.html": { + "http://www.w3.org/1999/xhtml/vocab#alternate": [ + "http://www.booking.com/hotel/br/best-western-sol-ipanema.pt-br.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.lv.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.el.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.vi.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.bg.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.et.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.sv.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.th.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ca.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.sk.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.fr.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ja.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.de.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.id.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.sl.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.fi.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ro.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.no.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.sr.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.hr.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ru.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.pl.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.nl.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.is.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ms.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ko.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.en-gb.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.zh-tw.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.it.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.hu.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.tl.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.he.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.pt-pt.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.uk.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.cs.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.es.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.ar.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.da.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.zh-cn.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.lt.html", + "http://www.booking.com/hotel/br/best-western-sol-ipanema.tr.html" + ], + "http://opengraphprotocol.org/schema/description": [ + "O Best Western Plus Sol Ipanema oferece uma localiza\u00e7\u00e3o excelente em frente \u00e0 Praia de Ipanema, em uma \u00e1rea animada repleta de bares e restaurantes." + ], + "http://opengraphprotocol.org/schema/url": [ + "http://www.booking.com/hotel/br/best-western-sol-ipanema.pt-br.html" + ], + "http://opengraphprotocol.org/schema/image": [ + "http://q-ec.bstatic.com/images/hotel/max300/252/25216239.jpg" + ], + "http://opengraphprotocol.org/schema/type": [ + "booking_com:hotel" + ], + "http://www.w3.org/1999/xhtml/vocab#stylesheet": [ + "http://q-ec.bstatic.com/static/css/main_edgecast/6a85ab590af4b04e06bf83ef799467cb8004188c.css", + "http://q-ec.bstatic.com/static/css/main_exps_edgecast/2da3060f29845ca3473745de3d5240825d875fc2.css", + "http://q-ec.bstatic.com/static/css/popups_edgecast/bfd3379059eb247e7ee9bfe880796e8128ddc522.css", + "http://r-ec.bstatic.com/static/css/hotel_edgecast/24fab22e3ef051a6962a40d7c5657e485da0192f.css", + "http://q-ec.bstatic.com/static/css/generic_profile_edgecast/e7179b3e770a877d344a7a8aa3e48109da0adf18.css" + ], + "http://www.w3.org/1999/xhtml/vocab#icon": [ + "http://r-ec.bstatic.com/static/img/b25logo/favicon/ebc77706da3aae4aee7b05dadf182390f0d26d11.ico" + ], + "http://www.w3.org/1999/xhtml/vocab#help": [ + "http://www.booking.com/faq.pt-br.html" + ], + "http://opengraphprotocol.org/schema/site_name": [ + "Booking.com" + ], + "http://opengraphprotocol.org/schema/title": [ + "Best Western Plus Sol Ipanema Hotel, Rio de Janeiro, BR" + ] + } +} diff --git a/PyOpenGraph/test/contents/hotelurbano.html b/PyOpenGraph/test/contents/hotelurbano.html deleted file mode 100644 index 33b864d..0000000 --- a/PyOpenGraph/test/contents/hotelurbano.html +++ /dev/null @@ -1,307 +0,0 @@ -Pacote: Meliá Angra, Angra dos Reis, R$ 420 | Hotel Urbano
- - - -
- -
- - - - - - - Fechar Busca - - - - Abrir Busca - -
-
- - -

Meliá Angra

Angra dos Reis, RJ

Resort na Praia + Grátis p/ Criança até 12 Anos*

Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ

Incluso no pacote

  • Academia

  • Apartamento

  • All inclusive

  • Área de lazer

  • Cofre

  • Estacionamento

  • Internet wireless

  • Piscina

  • Sauna

  • Camareira

  • Grátis para criança

Outras opções deste pacote

  • A: 1 Diária Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$420

  • B: 2 Diárias Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$850

  • C: 2 Diárias em Fins de Semana

    Entrada (check-in) Sexta-Feira e Saída (check-out) Domingo

    Por apenas

    R$929

  • D: 3 Diárias Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$1.259

  • E: 3 Diárias em Fins de Semana

    Entrada (check-in) a partir de Quinta-Feira e Saída (check-out) até Segunda-Feira

    Por apenas

    R$1.365

-

O que saber sobre este pacote

-
    -
  • -

    Validade

    -

    - De 14 de abril a 30 de setembro de 2014, para todos os dias da semana, inclusive fins de semana, de acordo com a opção escolhida no momento da compra, exceto semanas de feriados e eventos na região

    -

    -
  • -
  • -

    Política de Reservas

    -

      -
    1. -  A reserva deverá ser feita diretamente com o estabelecimento, até 14 dias antes da data desejada para entrada (check-in), mediante disponibilidade, pelos telefones (24) 3421-1115 | (24) 3421-1131 | (24) 3421-1103 | (24) 3421-1123 | (24) 3421-1121, de segunda à sexta, das 10h às 18h, ou pelos e-mails supreservas.angra@meliahotels.com.br | reservas2.angra@meliahotels.com.br, informando o período desejado para estada, os nomes dos hóspedes, as datas de nascimento, RG, CPF, e-mail e telefone para contato
    2. -
    3. - Após a confirmação de disponibilidade da data desejada, informe o código para reserva ao estabelecimento
    4. -
    -

    -
  • -
  • -

    Política de Reagendamento/Cancelamento

    -

    - Alterações na reserva poderão ser feitas até 20 dias antes da data agendada para a entrada (check-in), mediante disponibilidade. Será permitida apenas uma remarcação

    -

    -
  • -
  • -

    Crianças e Camas Extras :

    -

    *Gratuidade para 1 criança de até 12 anos, hospedada na mesma acomodação do responsáveis

    -

  • -
  • -

    Internet :

    -

    Wi-Fi Grátis

    -
  • -
  • -

    Políticas do Estabelecimento

    -

    Check in: 15:00

    -

    Check out: 12:00

    -
  • -
  • -

    Outras Informações

    -

      -
    1. - O pacote inlcui sistema All Inclusive de alimentação com comidas e bebidas alcoólicas e não alcoólicas, à vontade até às 23h, dentro dos horários pré-estabelecidos
    2. -
    3. - Capacidade máxima na acomodação: 2 adultos e 1 criança de até 12 anos
    4. -
    5. - Política para hospedagem de menores: crianças menores de 18 anos, acompanhados dos responsáveis, deverão apresentar na entrada (check-in) documento com foto, que comprove identidade e filiação/guarda. Crianças menores de 18 anos sem a companhia dos responsáveis,  deverão apresentar na entrada (check-in) documento de autorização de hospedagem, assinado por um dos pais ou responsável legal, com firma reconhecida em cartório
    6. -
    -

    -
  • -
  • -

    Estacionamento :

    -

    Grátis

    -
  • - -
  • -

    Taxas

    -

    - Valores referentes a impostos e taxas administrativas já estão incluídos no momento da finalização da compra, no site do Hotel Urbano (não sendo necessário, após a finalização da compra, o pagamento de nenhum tipo de taxa)

    -

    -
  • -
  • -

    Tipo de Acomodação

    -

    Apartamento Superior com vista para o jardim, duas camas queen size ou uma king, e sofá cama

    -
  • -
  • -

    Localização

    - - -

    Endereço: Rodovia Rio Santos, Km 488 - CEP: 23942300 - Pontal - Angra dos Reis - RJ - BR

    -
  • -
  • -

    Nome Empresarial: Meliá Angra

    -

    CNPJ ou CPF : 62413877003853

    -

    Endereço: Rodovia Rio Santos (BR-101), 488 - CEP: 23942300 - Pontal - Angra dos Reis - RJ - BR

    - - -

    Web site: http://pt.melia.com/hoteis/brasil/angra-dos-reis/melia-angra-marina-and-convention-resort/home.htm

    -
  • -
-
-
  • Diarias

    1

    diária

  • Pessoas

    2

    Pessoas

Mais procurada da semana

Só restam 4 pacotes a esse preço.

De: R$ 699

R$420

6 x de R$ 70,00 sem juros

40% Off

Leva apenas 2 minutos

-
- - diff --git a/PyOpenGraph/test/contents/hotelurbano.json b/PyOpenGraph/test/contents/hotelurbano.json new file mode 100644 index 0000000..094ae9d --- /dev/null +++ b/PyOpenGraph/test/contents/hotelurbano.json @@ -0,0 +1,21 @@ +{ + "http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795": { + "http://www.w3.org/1999/xhtml/vocab#stylesheet": [ + "http://cdn.hotelurbano.com/css/sprites/sprite-forma-pgto__1401127929.css", + "http://cdn.hotelurbano.com/css/all__1401127930.css", + "http://cdn.hotelurbano.com/css/reset__1401127928.css", + "http://cdn.hotelurbano.com/css/style__1401127929.css", + "http://cdn.hotelurbano.com/css/jquery-ui.min__1401127930.css", + "http://cdn.hotelurbano.com/css/malert__1401127930.css", + "http://cdn.hotelurbano.com/css/ill-reset__1401127929.css", + "http://cdn.hotelurbano.com/css/sprites/sprite-principal__1401127929.css", + "http://cdn.hotelurbano.com/css/autocomplete2__1401127929.css", + "http://cdn.hotelurbano.com/css/lightbox__1401127930.css", + "http://cdn.hotelurbano.com/css/biblioteca__1401127929.css", + "http://cdn.hotelurbano.com/css/calendario-hoteis__1401127930.css" + ], + "http://www.w3.org/1999/xhtml/vocab#icon": [ + "http://www.hotelurbano.com/favicon4.ico" + ] + } +} \ No newline at end of file diff --git a/PyOpenGraph/test/contents/zappos.json b/PyOpenGraph/test/contents/zappos.json new file mode 100644 index 0000000..37256c6 --- /dev/null +++ b/PyOpenGraph/test/contents/zappos.json @@ -0,0 +1,33 @@ +{ + "http://www.zappos.com/timberland-pro-titan-safety-toe-oxford": { + "http://opengraphprotocol.org/schema/video": [ + "http://www.zappos.com/media/video/flvplayer/flvplayer-70110.swf?wmode=opaque&allowfullscreen=true&allowscriptaccess=always&stageW=480&stageH=281&showPreviewImage=false&videoUrl=http://www.zappos.com/media/video/7/2/4/7246644.flv&progressBarColor=#7399C6&rollOverColor=#7399C6&autoPlays=true" + ], + "http://www.w3.org/1999/xhtml/vocab#icon": [ + "http://www.zappos.com/favicon.ico" + ], + "http://opengraphprotocol.org/schema/type": [ + "product" + ], + "http://www.facebook.com/2008/fbmlapp_id": [ + "2357918308" + ], + "http://opengraphprotocol.org/schema/image": [ + "http://www.zappos.com/images/724/7246644/985-269904-d.jpg" + ], + "http://www.w3.org/1999/xhtml/vocab#stylesheet": [ + "http://www.zappos.com/prd/styles/facelift.p.20140514104429.css", + "http://www.zappos.com/prd/css/print.20140423085117.css", + "http://www.zappos.com/prd/styles/main.p.20140423085300.css" + ], + "http://opengraphprotocol.org/schema/url": [ + "http://www.zappos.com/timberland-pro-titan-safety-toe-oxford" + ], + "http://opengraphprotocol.org/schema/site_name": [ + "Zappos.com" + ], + "http://opengraphprotocol.org/schema/title": [ + "Timberland PRO TiTAN\u00ae Safety Toe Oxford" + ] + } +} \ No newline at end of file From 71fd7f914e3fab5829a2dd7771a824c2d4bb6650 Mon Sep 17 00:00:00 2001 From: Henrique Lopes Date: Wed, 28 May 2014 00:42:24 -0300 Subject: [PATCH 3/5] Adding the param prefix. --- PyOpenGraph/PyOpenGraph.py | 43 +++++++++++++++-------------- PyOpenGraph/test/PyOpenGraphTest.py | 2 +- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/PyOpenGraph/PyOpenGraph.py b/PyOpenGraph/PyOpenGraph.py index de444dc..729d408 100644 --- a/PyOpenGraph/PyOpenGraph.py +++ b/PyOpenGraph/PyOpenGraph.py @@ -30,25 +30,26 @@ ] class PyOpenGraph(object): - - def __init__(self, url=None, xml=None): - self.url = url - parser = rdfadict.RdfaParser() - if not xml: - result = parser.parse_url(url) - else: - result = parser.parse_string(xml, url) - data = result[url] - self.metadata = self.get_properties(data) - - def get_properties(self, data): - content = {} - for k, v in data.iteritems(): - for ns in OPENGRAPH_NAMESPACES: - if k.startswith(ns) and len(v)>0: - content[k.replace(ns, '')] = v[0] - return self._reprocess_content(content) - def _reprocess_content(self, content): - if len(content): - return content + def __init__(self, url=None, xml=None, prefix=True): + if prefix: + parser = rdfadict.RdfaParser() + if not xml: + result = parser.parse_url(url) + else: + result = parser.parse_string(xml, url) + else: + result = self._parse_web(url) + data = result[url] + self.metadata = self.get_properties(data) + + def get_properties(self, data): + content = {} + for k, v in data.iteritems(): + for ns in OPENGRAPH_NAMESPACES: + if k.startswith(ns) and len(v)>0: + content[k.replace(ns, '')] = v[0] + return content + + def _parse_web(self, url): + return {url:None} \ No newline at end of file diff --git a/PyOpenGraph/test/PyOpenGraphTest.py b/PyOpenGraph/test/PyOpenGraphTest.py index 0118c89..96da17b 100644 --- a/PyOpenGraph/test/PyOpenGraphTest.py +++ b/PyOpenGraph/test/PyOpenGraphTest.py @@ -56,7 +56,7 @@ def test_case_player_does_n_use_prefix_og_at_head_the_lib_should_be_process_with """ Case player does'n use prefix og at head, the lib should be process with beautiful soup. """ - og = o.PyOpenGraph('http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795') + og = o.PyOpenGraph('http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795', prefix=False) assert_equals(og.metadata['title'], 'Angra dos Reis, Meliá Angra, 7x de R$ 60,00') assert_equals(og.metadata['type'], 'website') assert_equals(og.metadata['site_name'], 'hotelurbano.com') From 90850b76b58b1bea0bdab6c0b8edaa58d437bde7 Mon Sep 17 00:00:00 2001 From: Henrique Lopes Date: Wed, 28 May 2014 23:26:45 -0300 Subject: [PATCH 4/5] Adding a new tests, creating a new file hotelurbano.html and updating of file setup.py --- PyOpenGraph/PyOpenGraph.py | 9 +- PyOpenGraph/test/PyOpenGraphTest.py | 26 +- PyOpenGraph/test/contents/hotelurbano.html | 307 +++++++++++++++++++++ setup.py | 65 ++--- 4 files changed, 364 insertions(+), 43 deletions(-) create mode 100644 PyOpenGraph/test/contents/hotelurbano.html diff --git a/PyOpenGraph/PyOpenGraph.py b/PyOpenGraph/PyOpenGraph.py index 729d408..5751fe7 100644 --- a/PyOpenGraph/PyOpenGraph.py +++ b/PyOpenGraph/PyOpenGraph.py @@ -21,7 +21,10 @@ #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN #THE SOFTWARE. +import re import rdfadict +import urllib2 +from bs4 import BeautifulSoup OPENGRAPH_NAMESPACES = [ "http://opengraphprotocol.org/schema", @@ -52,4 +55,8 @@ def get_properties(self, data): return content def _parse_web(self, url): - return {url:None} \ No newline at end of file + soup = BeautifulSoup( urllib2.urlopen(url).read() ) + content = {} + for og in soup.findAll('meta', {'property':re.compile('og:')}): + content["{0}/{1}".format(OPENGRAPH_NAMESPACES[0], og['property'].split(':')[1])] = [ og['content'] ] + return {url:content} \ No newline at end of file diff --git a/PyOpenGraph/test/PyOpenGraphTest.py b/PyOpenGraph/test/PyOpenGraphTest.py index 96da17b..4f06245 100644 --- a/PyOpenGraph/test/PyOpenGraphTest.py +++ b/PyOpenGraph/test/PyOpenGraphTest.py @@ -13,13 +13,15 @@ def __init__(self, _file, _type='html', code=200, msg='OK', headers={'content-ty self.msg = msg self.headers = headers - def parse_url(self, *arg): - handle = open(self.file_test) - html = "".join( handle ) - if self._type == 'json': - import json - return json.loads(html) - return html + def __getattr__(self, *args): + def func(*args): + handle = open(self.file_test) + html = "".join( handle ) + if self._type == 'json': + import json + return json.loads(html) + return html + return func def parse_string(self, *arg): pass @@ -52,12 +54,16 @@ def test_for_booking_web_site_the_lib_should_be_load_og_metas(self, p): assert_equals(og.metadata['site_name'], 'Booking.com') @patch('PyOpenGraph.PyOpenGraph.rdfadict.RdfaParser') - def test_case_player_does_n_use_prefix_og_at_head_the_lib_should_be_process_with_beaut_soap(self, p): + @patch('PyOpenGraph.PyOpenGraph.urllib2.urlopen') + def test_case_player_does_n_use_prefix_og_at_head_the_lib_should_be_process_with_beaut_soap(self, u, p): """ - Case player does'n use prefix og at head, the lib should be process with beautiful soup. + Case player doest'n use prefix og at head, the lib should be process with beautiful soup. """ + p.return_value = MockResponse('contents/hotelurbano', _type='json', headers={'content-type': 'text/javascript; charset=utf-8'}) + u.return_value = MockResponse('contents/hotelurbano') + og = o.PyOpenGraph('http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795', prefix=False) - assert_equals(og.metadata['title'], 'Angra dos Reis, Meliá Angra, 7x de R$ 60,00') + assert_equals(og.metadata['title'], u'Angra dos Reis, Meliá Angra, 6x de R$ 70,00') assert_equals(og.metadata['type'], 'website') assert_equals(og.metadata['site_name'], 'hotelurbano.com') assert_equals(og.metadata['url'], 'http://www.hotelurbano.com/pacote/rio-de-janeiro-angra-dos-reis-melia-angra/48795?cmp=895') \ No newline at end of file diff --git a/PyOpenGraph/test/contents/hotelurbano.html b/PyOpenGraph/test/contents/hotelurbano.html new file mode 100644 index 0000000..03c1c05 --- /dev/null +++ b/PyOpenGraph/test/contents/hotelurbano.html @@ -0,0 +1,307 @@ +Pacote: Meliá Angra, Angra dos Reis, R$ 420 | Hotel Urbano
+ + + +
+ +
+ + + + + + + Fechar Busca + + + + Abrir Busca + +
+
+ + +

Meliá Angra

Angra dos Reis, RJ

Resort na Praia + Grátis p/ Criança até 12 Anos*

Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ
  • Hotel em Angra dos Reis, RJ

Incluso no pacote

  • Academia

  • Apartamento

  • All inclusive

  • Área de lazer

  • Cofre

  • Estacionamento

  • Internet wireless

  • Piscina

  • Sauna

  • Camareira

  • Grátis para criança

Outras opções deste pacote

  • A: 1 Diária Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$420

  • B: 2 Diárias Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$850

  • C: 2 Diárias em Fins de Semana

    Entrada (check-in) Sexta-Feira e Saída (check-out) Domingo

    Por apenas

    R$929

  • D: 3 Diárias Durante a Semana

    Entrada (check-in) a partir de Domingo e Saída (check-out) até Sexta-Feira

    Por apenas

    R$1.259

  • E: 3 Diárias em Fins de Semana

    Entrada (check-in) a partir de Quinta-Feira e Saída (check-out) até Segunda-Feira

    Por apenas

    R$1.365

+

O que saber sobre este pacote

+
    +
  • +

    Validade

    +

    + De 14 de abril a 30 de setembro de 2014, para todos os dias da semana, inclusive fins de semana, de acordo com a opção escolhida no momento da compra, exceto semanas de feriados e eventos na região

    +

    +
  • +
  • +

    Política de Reservas

    +

      +
    1. +  A reserva deverá ser feita diretamente com o estabelecimento, até 14 dias antes da data desejada para entrada (check-in), mediante disponibilidade, pelos telefones (24) 3421-1115 | (24) 3421-1131 | (24) 3421-1103 | (24) 3421-1123 | (24) 3421-1121, de segunda à sexta, das 10h às 18h, ou pelos e-mails supreservas.angra@meliahotels.com.br | reservas2.angra@meliahotels.com.br, informando o período desejado para estada, os nomes dos hóspedes, as datas de nascimento, RG, CPF, e-mail e telefone para contato
    2. +
    3. + Após a confirmação de disponibilidade da data desejada, informe o código para reserva ao estabelecimento
    4. +
    +

    +
  • +
  • +

    Política de Reagendamento/Cancelamento

    +

    + Alterações na reserva poderão ser feitas até 20 dias antes da data agendada para a entrada (check-in), mediante disponibilidade. Será permitida apenas uma remarcação

    +

    +
  • +
  • +

    Crianças e Camas Extras :

    +

    *Gratuidade para 1 criança de até 12 anos, hospedada na mesma acomodação do responsáveis

    +

  • +
  • +

    Internet :

    +

    Wi-Fi Grátis

    +
  • +
  • +

    Políticas do Estabelecimento

    +

    Check in: 15:00

    +

    Check out: 12:00

    +
  • +
  • +

    Outras Informações

    +

      +
    1. + O pacote inlcui sistema All Inclusive de alimentação com comidas e bebidas alcoólicas e não alcoólicas, à vontade até às 23h, dentro dos horários pré-estabelecidos
    2. +
    3. + Capacidade máxima na acomodação: 2 adultos e 1 criança de até 12 anos
    4. +
    5. + Política para hospedagem de menores: crianças menores de 18 anos, acompanhados dos responsáveis, deverão apresentar na entrada (check-in) documento com foto, que comprove identidade e filiação/guarda. Crianças menores de 18 anos sem a companhia dos responsáveis,  deverão apresentar na entrada (check-in) documento de autorização de hospedagem, assinado por um dos pais ou responsável legal, com firma reconhecida em cartório
    6. +
    +

    +
  • +
  • +

    Estacionamento :

    +

    Grátis

    +
  • + +
  • +

    Taxas

    +

    + Valores referentes a impostos e taxas administrativas já estão incluídos no momento da finalização da compra, no site do Hotel Urbano (não sendo necessário, após a finalização da compra, o pagamento de nenhum tipo de taxa)

    +

    +
  • +
  • +

    Tipo de Acomodação

    +

    Apartamento Superior com vista para o jardim, duas camas queen size ou uma king, e sofá cama

    +
  • +
  • +

    Localização

    + + +

    Endereço: Rodovia Rio Santos, Km 488 - CEP: 23942300 - Pontal - Angra dos Reis - RJ - BR

    +
  • +
  • +

    Nome Empresarial: Meliá Angra

    +

    CNPJ ou CPF : 62413877003853

    +

    Endereço: Rodovia Rio Santos (BR-101), 488 - CEP: 23942300 - Pontal - Angra dos Reis - RJ - BR

    + + +

    Web site: http://pt.melia.com/hoteis/brasil/angra-dos-reis/melia-angra-marina-and-convention-resort/home.htm

    +
  • +
+
+
  • Diarias

    1

    diária

  • Pessoas

    2

    Pessoas

Mais procurada da semana

Só restam 4 pacotes a esse preço.

De: R$ 699

R$420

6 x de R$ 70,00 sem juros

40% Off

Leva apenas 2 minutos

+
+ + diff --git a/setup.py b/setup.py index e9b3f93..edb21e8 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,36 @@ from distutils.core import setup +""" + ============= + PyOpenGraph + ============= + PyOpenGraph is a library written in Python for parsing Open Graph protocol information from web sites. + + Learn more about the protocol at: + + http://opengraphprotocol.org + + -------------- + Installation + -------------- + + To install, download the archive at http://pypi.python.org/pypi/PyOpenGraph and decompress, run python setup.py install. + + ------- + Usage + ------- + :: + + import PyOpenGraph + + og = PyOpenGraph('http://www.rottentomatoes.com/m/10011268-oceans/') + + print og.metadata # => {'url': 'http://www.rottentomatoes.com/m/10011268-oceans/', 'site_name': 'Rotten Tomatoes', 'image': 'http://images.rottentomatoes.com/images/movie/custom/68/10011268.jpg', 'type': 'movie', 'title': 'Oceans'} + + print og.metadata['title'] # => Oceans + + og.is_valid() # => return True or False +""" setup( name = 'PyOpenGraph', version = '0.2', @@ -11,38 +42,8 @@ download_url = 'http://pypi.python.org/pypi/PyOpenGraph', platforms = 'Any', license = 'MIT License', - long_description='''\ -============= - PyOpenGraph -============= - -PyOpenGraph is a library written in Python for parsing Open Graph protocol information from web sites. - -Learn more about the protocol at: - -http://opengraphprotocol.org - --------------- - Installation --------------- - -To install, download the archive at http://pypi.python.org/pypi/PyOpenGraph and decompress, run python setup.py install. - -------- - Usage -------- -:: - - import PyOpenGraph - - og = PyOpenGraph('http://www.rottentomatoes.com/m/10011268-oceans/') - - print og.metadata # => {'url': 'http://www.rottentomatoes.com/m/10011268-oceans/', 'site_name': 'Rotten Tomatoes', 'image': 'http://images.rottentomatoes.com/images/movie/custom/68/10011268.jpg', 'type': 'movie', 'title': 'Oceans'} - - print og.metadata['title'] # => Oceans - - og.is_valid() # => return True or False -''', + long_description=__doc__, + install_requires=['rdfadict', 'beautifulsoup4==4.3.2', ] classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', From a6b7265e108ccdffd446a70da76fca206c2f776a Mon Sep 17 00:00:00 2001 From: Henrique Lopes Date: Wed, 28 May 2014 23:35:18 -0300 Subject: [PATCH 5/5] Updating files gitignore and setup.py --- .gitignore | 1 + setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 045b40f..7fb122b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.pyo dist/* requirements.txt +build/* diff --git a/setup.py b/setup.py index edb21e8..791b653 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ platforms = 'Any', license = 'MIT License', long_description=__doc__, - install_requires=['rdfadict', 'beautifulsoup4==4.3.2', ] + install_requires=['rdfadict', 'beautifulsoup4==4.3.2', ], classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console',