Zambrano

From Ancestry.com Wiki

(Difference between revisions)
Jump to: navigation, search
(Haplogroup E-M215 (Y-DNA))
Line 943: Line 943:
====''[[Haplogroup E-M215 (Y-DNA)|Em183]] [[Berber]], South West
====''[[Haplogroup E-M215 (Y-DNA)|Em183]] [[Berber]], South West
[[Spain]].''====
[[Spain]].''====
 +
 +
[[Portal:Berbers]]
[[Portal:Berbers]]
 +
 +
http://en.wikipedia.org/wiki/History_of_Tunisia
*Berber refer to the [[Barbara (region)]].
*Berber refer to the [[Barbara (region)]].

Revision as of 23:03, 1 August 2013

Template:TOC limit Template:Infobox peerage title

Template:Infobox royalty

File:TorreMendoza.JPG
House of Mendoza Castle looks like castle in Zambrana crest.

Contents

Fortun Sanchez Grandee Zambrana.[1]

Fortun Sanchez of Mendoza,Vitoria-Gasteiz, Spain. [2] was the first Grandee Zambrana, [3] receiving his title in Burgos on 1058 and died in 1088. [4] [5] [6] The grandee title was given to him by [[Sancho IV of Navarre]], for his service to Sancho III of Navarre and to Garcia Sanchez III of Navarre, The Zambrana family crest shows two silver stars for this service to the crown. [7] Fortun serve as page and squire until he became lord Zambrana. [8] [8] [7]. [8] [8]

Zambrana, Spain came to be after the [[Solar (Spanish term)|Solares]] or house mark Zambrana became Villa Zambrana[9]

Due to the many

languages spoken in Spain, many spelling variations of the same name are shown in history. Spain, France and England have records of the Zambrano in their historical documents as follows; Zambrana,Zambrano,Cambrano,Sambrano,Sembrano,Zambraos,Zambranok are among the most noted in history.[10][11][12]

Library of congress: Endika de Mogrobejo continued the work and in Endika's volume 13 I found the article on the Zambranos. The citation is: <http://lccn.loc.gov/95184192>.

Family Crest Zambrana

Zambrana, Navarre

This was the first arms awarded to Zambrana. A citizen of Zambrana is refer to as Zambrano. Zambrana being a lord ship Surname, Zambrano a topophonic name.

The Zambrano later receive their arms,Ochoa Zambraos Family being the first. This family serve in Germany, Italy and England. And They were part of the first colonies in America.

Jaen, Baeza, Ubeda, Linares


The Zambrana Family moved Jaen territory. Following Fernand III who recorded his Charter in the arch of Alcanzar. Both Zambrana and Zambrano recorded in this territory. They donated their land to the Catholic Monasteries.

Linares Zambrano Arms shows a Marquez of Zambrana as governor of the land. Apointted by Phillip II of Spain.

This arms can be seen in this old record:

http://diegomallen.blogspot.com/2011/01/usurpacion-de-armas-de-don-pedro-de.html

Murcia


Zambrana Family Govern over the Castle under Henry III of Spain.

Netherlands, flanders

The First Zambrano to receive his arms join Charles V in Flanders Armies. They later travel to England under his son Phillip II.

England


This are the arms of the first Zambrano. The red castile and Gules Reus Shows Service to Flanders and England. The Blue stars may have originated from their union with the Ortiz adn Frias families.

Juan Zambrana Died with no male Peerage.

The Zambranok surname is mention in records but no information is available.

Castilla Leon

Burgos was the place were the first Zambrana recieve his arms. The Zambrana and Zambrano branch out and they share a common origin, they also share the same territory. Looking to see if they are conected to Ochoa Zambrano families.

Andalusia


All Zambrana and Zambrano Families moved to Arcos de la frontera. From here they moved all over America and Phillippines.

Madrid

This Zambrana Family is recorded to have united with Ponce de Leon Family. When they travel to America they change their surname to Zambrano?

Francisca Zambrana became Frnacisca Zambrano, She marry to one of Ponce de Leon Guards who died in Alta Califroania. She LIved in Colima Mexico one of the first colonies in America.

Extramadura

The Zambrana and Zambrano are well recorded in this territory, mainly Fuente del Maestre.

Catambria

Misc


Zambrana or Zambrano.[9] [5] [1] [16]

Castile Silver: A family establish by a Royal gold family of

Castile. Silver Moon, Sole duty to protect the maiden ladies and the orphans.

2 Silver Stars: Represent Service to King [[Garc�a S�nchez III of

Navarre]] and King Sancho III of Navarre

8 Golden saltire Cross: Cross of St. Andrew. Conquest of

Baez or Baeza. And the 8 count marks as a new family from a existing family or Grandee. Gold Sun, Sole duty is to protect the prince to the Death, and guard the poor.

Red field or Gules, Mars, Victory.
Blue Border or Azure, Jupiter, Protector.

[http://www.monumentalnet.org/pais_vasco/alava/anana/salinas_de_anana/palacio_de_los_herran.php?vis=4 Zambrana Crest] in Palacio de Zambrana Herran[5]

[http://books.google.com/books/reader?id=m1UBAAAAQAAJ&printsec=frontcover&output=reader Zambrana crest Heraldic records] Page 40 Illustration. Record 730. page 42.


All the Zambrana(o) are known by this sigil. Those near sea

will add water waves; those that serve the French Kings will have a red castle and flower. Many Families sprouted all over Spain, Italy and America. The most important families are register in the Orders of Spain. The Zambranos that belong to these orders are the most important in history. They are Explorers, rich miners, zealots for the Catholic religion. The Zambrano were Inherited to the Kingdom of Granada after the Reconquista by the king�s of Spain. The Zambrano were inherited for their Castile lineage and service to the crown. The Zambrana(o) have monuments in Spain and America. They govern Castles, monuments, House mark , and regal tombs. According to the digital library of Spain and the genealogy science department there are 5 original families in America.

Service to the Kings of Spain, Germany, Italy and America (Indias).

  • Fortun Sanchez of Mendoza, Page to [[Garcia Sanchez III of

Navarre]] and to Sancho III of Navarre And became Lord Zambrana under Sancho IV of Navarre. [17]

  • Martin Alonzo De Zambrana, Conquest of Baeza in 1227.

[[http://bscw.rediris.es/pub/bscw.cgi/d507866/5%20-%20Lista%20Baeza | Los arcos del alcanzar.]] [[http://bscw.rediris.es/pub/bscw.cgi/507850?client_size=1020x579 | Lista de los 300 Soldados ]] [18] [19]

Govern over the castle Mula, Murcia,Spain.

  • Francisco Zambrana y Montemayor brother to Juan Perez de Zambrana

Regidor de Ubeda. [20] [21]

member of the order of Santiago. [17] [22]

  • Zambrano, Navarro, Alva."El carnicero" libro en aleman. Buscando.

German book in google books.


in England.

  • Jaun Zambrano Grnad child to Antonio Zambrano Serve in Bruges/Brujas.
  • Don Pedro Zambrano y Gordillo receive the title Marquez Zambrano

(Marquis von zambrano) on 1761, Under Spanish Empire. The title migrated to Italy under Ferdinand VII.. [23] [24] [25] [26] [27] [28] [29] [30] [31] [25] [32] [33] [34] [35] [36] [37] [38]

6. D. Miguel de Ibarrola y González, Marqués de Zambrano.[39]

7. Mateo Toro Zambrano, Marquez Zambrano: Zambrano armas from Ucles.[40]

Zambra and Zamorano became Zambrano in America

Zambra[41][42][43]

The Zambra Family belong to the Barnuevo Family year 1435. Calatrava order templar family. Zambra family shows sinople tree, w/ golden fruit in golden field. Sobreabo tree shows Zambrana origin.

Pedro rodrigez de Zambra[44]: Original from Ubeda. His family moved to Portugal and became Zambrano. Arms are Zambrana. Martin Fernandez Zambrano.


Barnuevo shows 4 quarter shield Castile and calatrava.

Zamora Family are related to the Princes of Castile. Year 1067. Identical to Zambrana but with fleur de reus were the saltire cross would be.

Zambrano in Arab records.[12]

Lineage

Template:Ahnentafel top

Template:Ahnentafel-compact5

Template:Ahnentafel bottom


Grandee Vizcaya [45][46] [7]

[[Basque se�or�os]] Lord of Biscay[47]

As per the records of the Roda Codex

Family tree for Jimeno of Pamplona and Banu Qasi[48]

Father:[[Fort�n Garc�s of Pamplona]][49] [50] [51] [52] [53]

Mother: Aurea daugther of [[Lop ibn Musa]].[54]

Children: ��igo Fort�nez Aznar Fort�nez,Blasco (Velasco) Fort�nez,Lope Fort�nez,[[Onneca Fort�nez]]

1) D. Lope Fortunez Jaun Zuria "The white Lord" 1st Grandee of Vizcaya[55][56] [http://fr.wikipedia.org/wiki/Zuriain Zuriain][57]

Da. Dalda daugther of D. Sancho Estiguiz Grandee of [[Durango,

Biscay|Durango]]

2) D. Munio Lopez or Manso Lopez 2nd Grandee of Vizcaya, Grandee Lopez.[58]

Da. Velazquita o Blasquita Daughter of Sancho II of Pamplona[59]

3) Inigo Lopez 3rd El Ezquerra "left hand"Grandee of Vizcaya

4) Lope Diaz 4th Botiller Grandee of Vizcaya

Elvira Bermudez

5)Father: Sancho Lopez 5th Grandee of Vizcaya [60] [9] House Mendoza [9] [61]

Princes Dona Urraca Daughter of Sancho I of Pamplona
Uncle: Inigo Lopez Esquerra as his granfather. Grandee Haro

after conquest of Baeza.

Brother: Lope Sanchez Grandee Laudio/Llodio[60]

Fortun Sanchez Mendoza Squire that became Grandee Zambrana


Surnames from Navarra/Pamplona or Biscaya have Wolf Sable or Sinople Tree.[62]

Fortun Sanchez was given his grandee title after the conquest of Baeza or Paez.[63] Fortun receive the title of lord do to his royal lineage [45] [64] , Lope Fortunez Jaun Zuria �The white lord� the 1st [[Lord of Biscay]] was son to [[Fort�n Garc�s of Pamplona]] recorded in the Roda Codex.[45] The lords of vizcaya joined the Pamplona/Navarra kingdom by the marriage of Velasquita Daughter of Sancho I of Pamplona and the 2nd lord of viscaya Munio Lopez uncle to Fortun Sanchez. Fortun Sanchez is son to Count Sancho Lopez the 5th Lord of Biscay and Dona Urraca Sanchez daughter of Sancho I of Pamplona who became Queen of Leon and mother to Sancho I of Leon. His brother Lope Sanchez serve as Manager to king Sancho III of Navarra and became the 6th Lord of Biscay and was the first to receive a family crest.

Grandee Lope Fortunez has a house mark in Zuriain. And is recorded as the 1s Lord of Viscay. (Jaun, Fuero , Count or Grandee).[65]



Grandee Zambrana [9]

1) Fortun Sanchez De Zambrana.[68] [69][70]

Toda

2) Martin Alonso De Zambrana.

3) Juan De Zambrana.

4) Pedro Sanchez Iniguez De Zambrana. Serve Henry III of Castile Govern over the castle Mula, Murcia,Spain.

5) Nofre De Zambrana.

6) Pedro Zambrana. Squire to Charles V, Holy Roman Emperor, and Member of the order of Santiago.[71]

7) Don Pedro Martin De Zambrana. Grandee Torralba[72]

8) Don Pedro Iniguez De Zambrana. 17th Century.

9) Don Pedro Zambrana Fajardo. His Brother Don Manuel Zambrana Guerrero died with no children, they belong to the [[order of Santiago]].

Francisca Zambrana(o) move to america, lived in colima Mexico, Her

husband worked for Ponce de Leon Family and died in California.

10) Ana Zambrana.

11) Dona Cathalina Maria De Zambrana. Her family belongs to the order of Alcantara.

12) Dona Ginesa Junteros y Zambrana. She Belongs to the Ponce De Leon Family.


Template:Ahnentafel top

Template:Ahnentafel-compact5

Template:Ahnentafel bottom

Template:Ahnentafel top

Template:Ahnentafel-compact5

Template:Ahnentafel bottom

Zambrano DNA by location

Haplogroup E-M215 (Y-DNA)

South migration from Palestine to south Europe and North Africa.

====Em183 Berber, South West Spain.====


Portal:Berbers

http://en.wikipedia.org/wiki/History_of_Tunisia

  • The berber oroginated from Etiopia. The berber were conquer by the Egyptian and Arab empires. The Berber Jews group settle in Gaul. Berber and visigoths are recorded to mix during this time, one of this family are the Banu Qasi.
  • Kingdom of Granada Vassal for Spanish Catholic Kings.[74]

Haplogroup R-M207

Migrated from Palestine to Asia mostly, Europe and Africa.

R1b Basque

The basque people grew with in the same territory as the british Britania. This can be seen on their flag with is the english jack with different colors.

The basque people have been divided by the Spanish March.

Haplogroup J-M172

Migrated from Palestine to Asia Mostly and Europe.

  • Caucasus: White people of Palestine. This group moved to Europe as the Basque.

Email me to add your dna and location or you can do dna test kit here.

http://www.familytreedna.com/public/ZAMBRANO/default.aspx?section=yresults

Monuments

[http://dspace.unia.es/bitstream/10334/380/1/05JIIITII.pdf EL CONVENTO DE SAN JUAN BAUTISTA DE VILLALBA DEL ALCOR] A tomb shows Ponce De Leon tomb with Zambrano family crest. Alonso Zambrano And Rodrigo Zambrano and his family were companions in his explorations. Historical records show the Zambrano Family marry into the Ponce De Leon Family. Google map the adress, calle de Francisco Alcal� #40, Villalba del Alcor, Seville, Spain.

[http://www.castillosnet.org/programs/castillosnet.php?tip=ficcas&dat=murcia/MU-CAS-018 Castillo de Mula:] Zambrana Family serve as Governor of the castle.Castle is located in the mount North of present mula city , Murcia, Spain.

[http://es.wikipedia.org/wiki/Baeza_(Espa%C3%B1a) Arco de Alcanzar Baeza"Plaza del populo":][5] [75] Arco de Alcanzar de Baeza or Plaza del populo or Arco de los Leones. Has the Zambrano Crest as great Heros. The code of arms in the arc directly infront of the fountain of lions is the Zambrana code of arms.

[https://maps.google.com/maps/ms?msid=200173334021275347501.0004cf0969bdc5096d1c9&msa=0 Puerta de Dona Urraca]Built at the end of the 10th century, later given the name Zambranos. The arc gate was part of the Zambranos Palace. This is a Spanish Monument of great historical importance.

[https://maps.google.com/maps?q=fuente+del+maestre&hl=en&sll=37.328048,-6.498338&sspn=0.094186,0.142479&t=h&hnear=Fuente+del+Maestre,+Province+of+Badajoz,+Extremadura,+Spain&z=10 Fuente del Maestre]. Zambrano Family members lived here as great orders of spain. [76] [10] [77]

All this monuments are available to see in google earth. [https://maps.google.com/maps?saddr=mula+spain&daddr=Puerta+de+Do%C3%B1a+Urraca+%4041.504693,-5.74874+to:fuente+del+populo+baeza+to:calle+de+Francisco+Alcal%C3%A1+40,+Villalba+del+Alcor+to:fuente+del+maestre&hl=en&ie=UTF8&ll=41.153842,-3.691406&spn=4.127309,9.832764&sll=38.702659,-3.47168&sspn=4.277687,9.832764&geocode=Fe9zRAIdB1Lp_ynJJHo2RF5kDTFg6iLXbq8CBA%3BFbVPeQId_Eeo_w%3BFUK2QwIdiAvL_yE750DEMCCeBCmFTtbzl4tuDTE750DEMCCeBA%3BFVihOgIdmzed_ymN62IkFfQRDTFATD7C9OuB_Q%3BFXTmSwIdSJWd_ykNlmksMKoWDTEA95-M_WMEBA&t=h&mra=ls&z=7 Click here] for a map with driving directions to all the monuments.

[http://www.monumentalnet.org/pais_vasco/alava/anana/salinas_de_anana/palacio_de_los_herran.php Palacio Zambrana and Herran], Located in [[A�ana]], Spain

[http://www.panoramio.com/photo/48051008 Palacio Zambrana], Located in [[Linares, Ja�n]], Spain[13][[http://dialnet.unirioja.es/servlet/articulo?codigo=1123399 | Linaje de Zambrana pdf.]][14]


[http://www.banosdelaencina.es/_detalles-galeria-unica.html?uid=113096c9-40da-11e0-8191-79fb06ed8546 Casa de Caridad Zambrano] "Image 11 of 18", [http://www.panoramio.com/photo/6250048 Banos de la encina], Spain.

Kingdom of Granada (Crown of Castile). Zambrano Family. [78]


America (Colonial 1492-1800)

[[Casa de Contrataci�n]] Sevilla. Crews logs data base. [http://pares.mcu.es/MovimientosMigratorios/staticContent.form?viewName=fuentes2 Main Web page Casa de contratacion] [79]

Zambrano en Sevilla. [80]


Juan Zambrano, Guadalajara, Spain, Died in battle under Charles V. 1535. [81]

Rodrigo Zambrano [82]


Manuel Zambrano [83]


Hernando de Soto Alvaro Zambrano part of crew.[84] [22]


St. Augustine, FloridaRodrigo Zambrano y Alonso Zambrano and two sisters 1 Servant.


[http://www.panoramio.com/photo/50578904 Casa Museo Alfonso Zambrano]. Woodcraft master . [http://www.culturapasto.gov.co/index.php?option=com_content&view=article&id=26:museo-alfonso-zambrano&catid=6:museos-pasto&Itemid=4 Gallery].

Clergyman

Fray Juan Zambrano, Chiapas, Mexico. Service to the church in 1537. [85]

Ecuador: MonSenor Alverto Zambrano, Bishop from Loja, Ecuador. [86] [[http://www.diocesisdeloja.org/obispos%20historia.html]]

Mexico colonies.

[87] [88]

Durango Mexico.

Palacio Zambrano Juan Jose Zambrano from the Order of Santiago.[89][90] [91]

Jalisco Mexico

[http://www.panoramio.com/photo/40415978 Hacienda de Zambrano]. Jalisco Mexico. Near Sierra de los lobos. and Leon Guanajuato.

Chile

Government Junta of Chile (1810) President Mateo de Toro Zambrano. Casa solar Casa Colorada [[http://es.wikipedia.org/wiki/Casa_Colorada]]

New Mexico

[[Mission Nuestra Se�ora de los �ngeles de Porci�ncula de los Pecos]] Fray Pedro Zambrano Ortiz.

California.

[[Mission San Fernando Rey de Espa�a]] Manuel Nicolas Zambrano, Order of Santiago.[92] [92]

Spanish Empire Netherland, Italy and (Indias America and philippines).

Don Pedro Zambrano y Gordillo, Marquez Zambrano (Marquis von zambrano)1761. Under Spanish Flanders. The title migrated to Italy under Ferdinand VII.. [23] [24] [25] [26] [27] [28] [29] [30] [31]

Spain

[http://www.acsandino.org.ni/index.php?option=com_content&view=article&id=42&Itemid=115 ORLANDO JOS� ZAMBRANO B�EZ]., Born in 1� de Septiembre de 1894, and Died on 13 de Noviembre de 1959.


Texas.

Juan Manuel Zambrano [93]

[http://books.google.com/books?id=1X4FAAAAQAAJ&pg=PA186&dq=zambrano+laredo+tejas&hl=en&sa=X&ei=Ot-OUKeRJMG82wXGxYGYAQ&ved=0CC8Q6AEwAA#v=onepage&q=zambrano%20laredo%20tejas&f=false Canas de Zambrano in Texas colony 1789] Republic of Texas[94] [95] [96][94][97] [http://www.tamu.edu/faculty/ccbn/dewitt/zambrano.htm Zambrano Spanish Index]


Mexico Monterey.

[98]

Nuevo Leon.

[98] [99] [100] [101] [102]

Nueva granada (South America).

[103] [104] [105] [106] [107]


Italy.

[108] [109] [110] [111]

Uruguay.

Jose Zambrano y Vienna [112] [113]

Philippines.

Andres Zambrano [114] [115]

Spanish Monasteries.

[116]

Argentina.

[117] [118] [119] [120] [121] [122]


Ecuador.

Ramon Zambrano. [123] [124] [125]


Colombia.

Manuel Zambrano y Benavides. [126]

Alvaro Zambrano 1770. [http://www.culturainmaterial.com/montesdemaria/index.php?option=com_content&view=article&id=83&Itemid=85 Puerto Zambrano]. [127] [128] Founded House mark [[Zambrano, Bol�var|zambrano]] in 1770, became Villa San Sebastian de las playas blancas. Colombia.

[http://www.panoramio.com/photo/50578904 Casa Museo Alfonso Zambrano]. Woodcraft master . [http://www.culturapasto.gov.co/index.php?option=com_content&view=article&id=26:museo-alfonso-zambrano&catid=6:museos-pasto&Itemid=4 Gallery].


Spanish Netherlands.

[129] [30] [31] [32] [130]

Canay Islands.

Zambrana House mark. [131]

Fray Pedro Zambrano


Brazil

Zambrano Brazil: Rodrigo Zambrano 1512. [132]


Other languages not classified

Mr. Zambrano 1825. Paris France. [133]


WWI and WWII

Juan Zambrano: [http://www.forces-war-records.co.uk/Search?vbm=home_guard_mailer_wednesday&id=464408&cid=3250856 Dads Army England]

Present times 1900-present

Lorenzo Zambrano. Alemania [135]

Tom Zambrano. [136]

Lorenzo Zambrano. Mexico [137]

Fabio Zambrano. Colombia. [138]

Myrna Zambrano. [139]

Google map locations for Zambrana and Zambrano, City or St.

USA Streets

Zambrano ST.

https://maps.google.com/maps/place?q=Zambrano+Street,+Commerce,+CA,+USA&hl=en&ftid=0x80c2ce60b75eb617:0x46475d1d204d972d

https://maps.google.com/maps/place?q=Zambrano+Road,+San+Antonio,+TX,+USA&hl=en&ftid=0x865cf50c0510d017:0xd21a21a410c1e5f4

https://maps.google.com/maps/place?q=Zambrano+Drive,+Woodland+Park,+NJ,+USA&hl=en&ftid=0x89c2fe167237aff1:0xd865ddb3ccb4611d

https://maps.google.com/maps/place?q=Zambrano,+USA&hl=en&ftid=0x865fcba98a8854f7:0xe63b8e1613151fb

https://maps.google.com/maps/place?q=Zambrano+Road,+San+Antonio,+TX,+USA&hl=en&ftid=0x865cf50c0510d017:0xd21a21a410c1e5f4

Zambrana ST.

https://maps.google.com/maps/place?q=Zambrana+Street+Southeast,+Palm+Bay,+Florida&hl=en&ftid=0x88de72a4cc6a2b73:0x686c58f33c3df90e

https://maps.google.com/maps/place?q=Zambrana+Avenue,+North+Port,+Florida&hl=en&ftid=0x88dcace724e5a453:0x27cc5eb93a179c10

https://maps.google.com/maps/place?q=Zambrana+Street,+Sebring,+Florida&hl=en&ftid=0x88dcf8ec46e6eb49:0x3665ec084c426969

https://maps.google.com/maps/place?q=Zambrana+Street,+Coral+Gables,+Florida&hl=en&ftid=0x88d9c89ef41e1705:0x8212675a03f82686

Puerto Rico

Zambrana St. https://maps.google.com/maps/place?q=Cll+Zambrana+East,+Coamo,+Puerto+Rico&hl=en&ftid=0x8c03330cb01e4457:0x45bd91acfa4dc99c

Spain Street

https://maps.google.com/maps/place?q=Calle+Zambrana,+Linares,+Spain&hl=en&ftid=0xd6e84ccc3a243fb:0x82eafa56194e14d4

https://maps.google.com/maps/place?q=Calle+de+Zambrana,+Zambrana,+Spain&hl=en&ftid=0xd4f920a9bceb8ed:0x1a0a255deb4bd468

Cuba, Zambrana st.

https://maps.google.com/maps/place?q=Zambrana,+Havana,+El+Cerro,+Havana,+Cuba&hl=en&ftid=0x88cd7a0bd1da1be5:0xd5fc39f4db6c8918

Panama, Zambrano city

https://maps.google.com/maps/place?q=Zambrano,+Piedra+Candela,+Renacimiento+District,+Chiriqui,+Panama&hl=en&ftid=0x8fa5ceb38f70c571:0xac2a31f80f8ae2f5

Chile, Zambrano City

https://maps.google.com/maps/place?q=zambrano,+chile&hl=en&ftid=0x9663070139f06cf3:0x97f1f57d151e11f4

Mexico, Zambrano city.

https://maps.google.com/maps/place?q=zambrano,+mexico&hl=en&ftid=0x842c41dd55bf3745:0x23ca16dc6886bc31

Colombia, Zambrano city

https://maps.google.com/maps/place?q=zambrano,+colombia&hl=en&ftid=0x8e5f30363720210d:0x62b62cfed56f08db

Ecuador, Zambrano street

https://maps.google.com/maps/place?q=zambrano,+ecuador&hl=en&ftid=0x8e2a3ccd34534d85:0x52b4dd26b2398566

http://maps.google.com/maps/place?q=Zambrano,+Quito,+Pichincha,+Ecuador&hl=en&ftid=0x91d59ab9f6656147:0xa6142529368d8b9d

Nicaragua, Zambrano City

https://maps.google.com/maps/place?q=zambrano,+nicaragua&hl=en&ftid=0x8f73f718e2aaec19:0x3e93b2a57d0294d7

Nicaragua, Zambrana City

https://maps.google.com/maps/place?q=zambrana,+nicaragua&hl=en&ftid=0x8f73f0b6d9d134b3:0x12dafd64ef6ae977

Argentina, Zambrano st.

https://maps.google.com/maps/place?q=zambrano,+argentina&hl=en&ftid=0x941bc36db35534f1:0x5fdd8dd1a8325faa

Ecuador, Zambrano St.

https://maps.google.com/maps/place?q=Zambrano,+Quito,+Pichincha,+Ecuador&hl=en&ftid=0x91d59ab9f6656147:0xa6142529368d8b9d

Philippines

Zambrano BLDG https://maps.google.com/maps/place?q=Zambrano+Bldg,+San+Fernando+City,+La+Union,+Region+I,+Philippines&hl=en&ftid=0x33918e41a2c2090d:0x97e3d3ec0260a805



Brazil

Villa Zambrano now Almodovar. https://maps.google.com/maps?q=Almod%C3%B4var,+Portugal&hl=en&ie=UTF8&ll=37.518985,-8.060532&spn=0.070391,0.109692&sll=37.269174,-119.306607&sspn=9.035627,14.040527&oq=Almod%C3%B4var&hnear=Almod%C3%B4var,+Beja+District,+Portugal&t=m&z=13 [140]


Resources

[http://www.bne.es/es/Micrositios/Guias/Genealogia/MapaWeb.html Geneology Hispanic]:Good source for Hispanic Names of Regal importance.

[http://www.jstor.org/discover/10.2307/40340398?uid=3739256&sid=56203014793 Historia Social:]Libro de historia zambrana. 2781 CHACON JIMENEZ, FRANCISCO HACIA UNA NUEVA DEFINICION DE LA ESTRUCTURA SOCIAL EN LA ESPA�A DEL ANTIGUO REGIMEN A TRAVES DE LA FAMILIA Y LAS RELACIONES DE PARENTESCO HISTORIA SOCIAL , 1995, (21): PP. 75-104.

[http://library.anaheim.net/Library/ Anaheim Public Library:]If you�re a Zambrano please donate to this library for providing information for the research.

[http://www.bne.es/es/Inicio/index.html Spain digital public library]:I provide links to the pdf. Use Ctrl+F to look for Zambrano reference

[http://bdh.bne.es/bnesearch/hemeroteca/Estado%20militar%20de%20Espa%C3%B1a%20(Ed.%20en%2016%C2%BA);jsessionid=84C84AE19AE15606E8B797D3C03ECC44 Estado Militar de Espana:] Zambrano Records and Orders of Spain they belong to.

[http://www.loc.gov/rr/hispanic/geneal/index_gc.html Link] to [[The Library of Congress]]

[http://en.geneanet.org/ Geneanet:] I surname database with heraldic data. And world wide surname population and density.

http://www.mcu.es/archivos/Novedades/novedades_Pasajeros.html

http://pares.mcu.es/MovimientosMigratorios/staticContent.form?viewName=fuentes2

http://www.bisabuelos.com/links.html

Heraldry websites

http://www.ngw.nl/heraldrywiki/index.php?title=Main_Page

http://www.contironco.it/index.htm

http://www.cnicg.net/legnob.asp

Consulta Araldica

Santiago Surname History

Template:Infobox peerage title

Template:Infobox royalty

The Santiago Familiy name or surname originates from the house of Quevedo in Pie de concha.[141] And Quevedo is from house Mantilla.[142][143][144]

Quevedo arms show arms from http://en.wikipedia.org/wiki/%C3%8Ele-de-France_(region)And the mantle of San Martin. Searching San Martin de quevedo. And Saint families origin.

848. Santiago. DeQuevedo house, located in the town of Pie de Concha proceeded to Santiago, whose illustrious sons are distinguished as follows: Don Pasquale and Don Domingo de Santiago, mayor of the city of Baeza in the reign of Don Alonso the Wise: the lawyer Toribio Gomez de Santiago, St. Bartholomew's College of Salamanca, the board of the Catholic Monarchs, his daughter Queen Juana and his son and successor Emperor Charles V: Don Fray Pedro de Santiago, religion overall barefoot St. Augustine, Bishop of Solsona and Lerida and Maestro Fray Juan de Santiago, known for his eloquent preaching and attractive Gold Pico Weapons of this illustrious lineageare: Silver shield and a red and white flag, held by two hands cut and bleeding 2.


� 0.6. Rodrigo Mantilla, Senior Cafa Mantilla, married Dona Maria of 7> tego Fernandez de Queuedo, died QUC 159z.procedienr.edel year folar fu dizevn name} and Mendoza, Nobiliario> * the CFAA, and folar of AI is Qucuedo Mountain, ay good kijfofdalgo delta, but not in fe�orio podero�os funds for weapons bring vn} e�cudo party eventually vneftandarte and cut it, that is l�tela half white, half colored c, and the middle cica-do is blue, right hand with three gold lilies, and the other half white cot� ?. vn black cauldron. And Caftillo: The lineage of Qucuedo is well-known in hijfofdalgo. eftos kingdoms, enjoyCafa (olariega in Pie de Concha, where 74 people have �alido � cn fr.Geronmo ejios many hijo�dalgo defta Cafa, the av in Guadalaxua, and elsewhere "')' C * itroCafltllobifit in Madrid afsifteD.FrancifcodcQueuedodclAbitodeSantiago ( juftamcrmi of RefesGodoSffol aqueltan held by IU great wit, eftudios, yefcritos, �e�or of � laTotrede uasrAbad) po� "4?2 / that here are two defta CAFAS vna familia.la faith draws deQucucdo Cafa of Santiago, and one that EFTA otr in Pie Shell enjoy ^ known both nobility and great antiquity. 'and D.AiUfi> efta.Ca�a Nu�iz of Santiago de Qucuedo defeender which will boast a and Martos, D. quefon Gua bifi.de Caftro Franci�co SantiagoGuzman, Luan father Alonfode Santiago Guzman, tenors dalsxara.ls \. I $ 5. ????4? ja ma? orazgo what DNDC Santiago, D-Iuandc mugerde Ortega and Aguilera, Queue per-Arms' fona of well known and remarkable quality. The hiftoria deGaadalaxara: The fon of do-Gone has one leros hijo�dalgo Caua Vizcaya, fu name is Pie de Concha de la Villa cieron ici na linage is Queuedo, ylaCa�adeQueuedoes in the Valley of the Vi cn Gu�aziua Pie de Concha call. Oh another Cafa Afturias Shell in Santillana-.rraen by ai * maslosQueuedos, quees�u own apellidu, vn e�cudo split into three loaves, cuclpti-ma mere right qo gold tresliles blue field inthe cauldron feguodQvnnegrojQQ silver champion, and the trio vn pcndon.la half red half field blanco.y by Rodrigo Msnrilla pfata.El and children D.MariadeQucuedo tuuuron fumuger Lop ^ M? Aniu, Dicgo Mantilia, D.Maria, D.Iacs) D.AoayD.VriuiafD.AldoDca and D.l�abei, what ma��doazelia, other were ca | adas, DM aria> qucera most, dexo two sons, Will * UI hij�jla husband D.Iscs tuuo Lu�n Mantilla de Soto the three men, and vna facm-, bi j 4,4.1 the adult of twelve years pafs� to Indies and China DEIDE Lima was Cutad � ^ fummvolugar.D.Ana another, and also children DELA D.Vt�uladexaron D. Aldon�� that. a. on FCIS sons, daughters} 1 and de�tos ptimos, and uncles, coc those of other lincas, fc car could ?? ooc�nros fighting men to VNtime. [145]

Santiago family crest

Red and white banner, bleeding praying hands, on silver field.

De Santiago Linage

Alonso Fernadez de Santiago Son to Sancho Fernandez de Santiago. and his wife Maria Sanz Mantilla.[78] Founded House Santiago.

References

Template:Reflist

  1. 1.0 1.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  2. http://www.cuadrilladeanana.es/zambrana/zambrana.php
  3. 5.0 5.1 5.2 5.3
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  4. 7.0 7.1 7.2
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  5. 8.0 8.1 8.2 8.3 {{cite book|title=Diario curioso, erudito, economico y comercial|url=http://books.google.com/books?id=MZUTM-Uh1qUC&pg=PA245|accessdate=19 November 2012|year=1787|publisher=Imp. de Manuel Gonzalez|pages=245�}}
  6. 9.0 9.1 9.2 9.3 9.4
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  7. 10.0 10.1 10.2
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  8. 12.0 12.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  9. 13.0 13.1 Template:Citebook
  10. 14.0 14.1 Template:Citebook
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  11. 17.0 17.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  12. 22.0 22.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  13. 23.0 23.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  14. 24.0 24.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  15. 25.0 25.1 25.2 {{cite book|title=Oesterreichischer Beobachter|url=http://books.google.com/books?id=ULNIAAAAcAAJ&pg=PA230|accessdate=18 March 2013|year=1847|publisher=Strau�|pages=230�}}
  16. 26.0 26.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  17. 27.0 27.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  18. 28.0 28.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  19. 29.0 29.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  20. 30.0 30.1 30.2
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  21. 31.0 31.1 31.2
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  22. 32.0 32.1 {{cite book|title=�sterreichischer Beobachter|url=http://books.google.com/books?id=wAM8AQAAIAAJ&pg=PA701|accessdate=23 March 2013|year=1833|publisher=A. Strauss|pages=701�}}
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  23. {{cite book|title=Neckar-Zeitung|url=http://books.google.com/books?id=ZPFDAAAAcAAJ&pg=RA2-PA787|accessdate=27 March 2013|year=1826|pages=787�}}
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  24. http://losejercitosdelrey.es/fernando7/1830_marques_de_zambrano/1830_marques_de_zambrano.html | Spanish, la biblioteca del Palacio Real, (sala VIII), bajo el título de “Colección de uniformes del Egército Español"
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  25. http://books.google.com/books?id=D8sqAAAAMAAJ&pg=PR187&dq=Pedro+rodrigez+de+Zambra&hl=en&sa=X&ei=bkh8UcDzGKHliAKn64HYBg&ved=0CDEQ6AEwAA
  26. 45.0 45.1 45.2 {{cite book|author=Francisco Rodriguez Garcia|title=Cronica Del Se�orio de Vizcaya|url=http://books.google.com/books?id=HDOU-YWlmIoC&pg=PA46|accessdate=20 November 2012|date=22 November 2002|publisher=Editorial MAXTOR|isbn=978-84-9761-029-2|pages=46�}}
  27. http://books.google.com/books?id=qFhpohL-NckC&pg=PA596&dq=toda+ortiz+fortun&hl=en&sa=X&ei=vXvjT5LTCIiA2gWCy6nJCw&ved=0CD4Q6AEwAg#v=onepage&q=for-tun%20sanchez%20mendoza&f=false
  28. http://personal.telefonica.terra.es/web/vizcayamedieval/armas.htm
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  29. http://www.euskomedia.org/aunamendi/52069
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  30. http://es.wikipedia.org/wiki/Fort%C3%BAn_Garc%C3%A9s
  31. http://books.google.com/books?id=MlA8AQAAIAAJ&pg=PA319&lpg=PA319&dq=lope+ortiz+y+maria+de+escocia&source=bl&ots=eR0PMx87_i&sig=myVWdSfmetOYRTtEIADGrY2k2hg&hl=en&sa=X&ei=bYBzUMClIMO3igKSioHoCA&ved=0CDAQ6AEwAA
  32. http://www.navarchivo.com/index.php/es/localidades/sanguesa/zuriain-esteribar?print=1
  33. http://books.google.com/books?id=Dr8QAQAAMAAJ&q=zuriain&dq=zuriain&hl=en&sa=X&ei=i8iRULbXI6Wh2QWA0YCYDQ&ved=0CD4Q6AEwBg
  34. {{cite book|author=Pedro Morote P�rez|title=Antiguedad, y blasones de la ciudad de Lorca, y Historia de Santa Maria la Real de las Huertas...|url=http://books.google.com/books?id=0CW9Y1btLoMC&pg=PA214|accessdate=20 November 2012|year=1741|publisher=por Francisco Joseph Lopez Mesnier, en la calle de Zambrana|pages=214�}}
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  35. 60.0 60.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  36. http://books.google.com/books?id=XYh-6AZyE0YC&pg=PA503&dq=fortun+sanchez+baeza&hl=en&sa=X&ei=CueKUPCwNqWc2AXFi4HwCQ&ved=0CDIQ6AEwAQ#v=onepage&q=fortun%20sanchez%20baeza&f=false
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  37. {{cite book|title=Enciclopedia general ilustrada del Pa�s Vasco: Diccionario enciclop�dico vasco.
  38. http://www.alltravels.com/spain/navarre/urdanoz/photos/current-photo-76264664
  39. {{cite book|author=Juan Antonio de Zam�cola|title=Historia de las naciones bascas de una y otra parte del Pirineo septentrional y costas del mar Cant�brico|url=http://books.google.com/books?id=_HwTAAAAQAAJ&pg=PA60|accessdate=21 November 2012|year=1818|pages=60�}}
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  40. {{cite book|author=Centro de Estudios Hist�ricos Internacionales (Barcelona, Spain)|title=Indice hist�rico espa�ol: bibliograf�a hist�rica de Espa�a e Hispanoam�rica|url=http://books.google.com/books?id=v8Tam6akCesC&pg=PA98|accessdate=21 November 2012|year=1953|publisher=Edicions Universitat Barcelona|pages=98�|id=GGKEY:N705USK76BP}}
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  41. Template:Citebook
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  42. http://books.google.com/books?id=kThAAAAAYAAJ&printsec=frontcover&dq=baeza&source=bl&ots=rmaq3cwDPl&sig=yjjzuynjscVOx1ZYTizMMH_rKls&hl=en&sa=X&ei=lh93UJawOKqViQLu9oHYDg&ved=0CEYQ6AEwBA#v=onepage&q=zambrana&f=false
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  43. 78.0 78.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  44. Template:CitefckLRbook
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  45. http://cdnc.ucr.edu/cdnc/cgi-bin/cdnc?a=d&amp;amp;cl=search&amp;amp;d=SFC18980123.2.95&amp;amp;srpos=1&amp;amp;e=-------en--20--1--txt-IN-juan+jose+zambrano----
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  46. 92.0 92.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  47. 94.0 94.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  48. 98.0 98.1
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': 'http://books.google.com/books?id=9PE2T2a5fDYC&ie=ISO-8859-1&source=gbs_gdata', 'description': 'Ramon Sarr\xc3\xb3 explores an iconoclastic religious movement initiated by a Muslim preacher during the French colonial period. Employing an ethnographic approach that respects the testimony of those who suffered violence as opposed to those who wanted to "get rid of custom," this work discusses the extent to which iconoclasm produces a rupture of religious knowledge and identity and analyzes its relevance in the making of modern nations and citizens. The Politics of Religious Change on the Upper Guinea Coastexamines the historical complexity of the interface between Islam, traditional religions, and Christianity in West Africa, and how this interface connects to dramatic political change. The book unveils a rare history and brokers a dialogue between a long tradition of anthropology and contemporary anthropological debates. A wide range of readers, particularly those with an interest in the anthropology of religion, iconoclasm, the history and anthropology of West Africa, or the politics of heritage, will gravitate toward this work.', 'format': 'book', 'publishers': ['Edinburgh University Press'], 'identifiers': [('google_id', '9PE2T2a5fDYC'), ('ISBN', '0748635157'), ('ISBN', '9780748635153')], 'thumbnail': 'http://bks9.books.google.com/books?id=9PE2T2a5fDYC&printsec=frontcover&img=1&zoom=5&edge=curl&sig=ACfU3U0LyllDnVUHiadMIrdIuvVAiURtuQ&source=gbs_gdata', 'subjects': ['Iconoclasm', 'Guinea', 'Iconoclasm/ Guinea', 'Religion and politics', 'History / Europe / General', 'Social Science / Human Geography', 'Social Science / Ethnic Studies / General', 'Social Science / Customs & Traditions', 'Religion / Ethnic & Tribal', 'Religion / General', 'History / Africa / General', 'Religion / Comparative Religion', 'History / General', 'History / Africa / General', 'Religion / Ethnic & Tribal', 'Religion / Islam / General', 'Religion / Religion, Politics & State', 'Social Science / Human Geography', 'Social Science / Islamic Studies', 'Travel / Africa / General'], 'authors': ['Ramon Sarr\xc3\xb3', 'John Smith', 'Jane Smith', 'Olaus Petrus', 'Mick Paff'], 'date': '2009-05-03', 'title': 'The Politics of Religious Change on the Upper Guinea Coast: Iconoclasm Done and Undone', 'viewability': 'view_partial', 'annotation': 'http://www.google.com/books/feeds/users/me/volumes'} #print 'Got dict: ' + str(thisdict)+ '
            ' #print thisdict['title'], "
            " title = thisdict['title'] if thisdict.has_key('title') else
            date = thisdict['date'] if thisdict.has_key('date') else publisher = (', '.join(thisdict['publishers'])) if thisdict.has_key('publishers') else authors = thisdict['authors'] if thisdict.has_key('authors') else coauthors = ', '.join(authors[3:]) isbn = issn = iccn = oclc = other_id_list = [] otherfields = [] if thisdict.has_key('identifiers'): for idpair in thisdict['identifiers']: if idpair[0].lower() == 'google_id': pass elif idpair[0].lower() == 'isbn': if len(idpair[1]) >= len(isbn): isbn = idpair[1] # Only keep the longest ISBN elif idpair[0].lower() == 'issn': issn = idpair[1] other_id_list.append('Template:ISSN') elif idpair[0].lower() == 'lccn': lccn = idpair[1] other_id_list.append('Template:LCCN') elif idpair[0].lower() == 'oclc': oclc = idpair[1] otherfields.append('oclc=' + oclc) elif idpair[0].lower() == 'doi': otherfields.append('doi=' + idpair[1]) else: other_id_list.append(idpair[0] + ':' + idpair[1]) other_id = ', '.join(other_id_list) if len(other_id): otherfields.append('id=' + other_id) bookdata = {'title': title, 'isbn': isbn, 'publisher': publisher, 'pages': page, 'url': new_url, 'authors': authors, 'date': date} jsonstr = json.dumps(bookdata, sort_keys=True, indent=4, ensure_ascii=False) jsonp = callback + '(' + jsonstr + ');' print 'Content-Type: text/javascript' print print jsonp memcache.add(memcache_key, jsonp, 3600)if __name__ == "__main__": main()
  49. Template:CitefckLRbook
          1. __author__ = 'Apoc2400'import wsgiref.handlersimport atom.urlimport gdata.serviceimport gdata.alt.appengineimport gdata.booksimport gdata.books.servicefrom google.appengine.api import memcacheimport sysimport osimport cgiimport cgitb; cgitb.enable()import reimport urllibfrom django.utils import simplejson as jsondef error(message): print 'Content-Type: text/plain' print print 'Error: ', messagedef main(): book_url = form = cgi.FieldStorage() if (not form.has_key("book_url")): error('No URL.') return book_url = form["book_url"].value if (not form.has_key("callback")): error('No callback.') return callback = form["callback"].value memcache_key = '5:' + os.environ['CURRENT_VERSION_ID'] + '/' + callback + ':' + book_url memcache_jsonp = memcache.get(memcache_key) if memcache_jsonp is not None: #print >> sys.stderr, "From memcache: " + memcache_key print 'Content-Type: text/javascript' print print memcache_jsonp return else: #print >> sys.stderr, "From fetch: " + memcache_key pass dateformat = if (form.has_key("dateformat")): dateformat = form["dateformat"].value checked_dmy = checked_mdy = checked_ymd = if dateformat == 'dmy': checked_dmy = ' checked="1"' elif dateformat == 'mdy': checked_mdy = ' checked="1"' elif dateformat == 'ymd': checked_ymd = ' checked="1"' else: checked_dmy = ' checked="1"' dateformat = 'dmy' if not re.search('books.google.', book_url, re.I) and not re.search('\?id=', book_url, re.I): error('Not a Google Books URL.') return urlsep = re.search('\?([^#]*)', book_url) if not urlsep: error('Bad URL.') return book_url_qs = urlsep.group(1) book_url_qs_fields = cgi.parse_qs(book_url_qs) if not book_url_qs_fields.has_key("id"): error('Bad URL. It has to be for a specific book, not a search result page') return book_id = book_url_qs_fields["id"][0] page = page_string = if book_url_qs_fields.has_key('pg'): page_string = book_url_qs_fields['pg'][0] match = re.search('\D*(\d+)', page_string) if match: page = match.group(1) + u"\u2013".encode("utf-8") new_url = 'http://books.google.com/books?id=' + urllib.quote_plus(book_id) if page_string: new_url += '&pg=' + urllib.quote_plus(page_string) client = gdata.books.service.BookService() gdata.alt.appengine.run_on_appengine(client) thisbook = client.get_by_google_id(book_id) # '8cp-Z_G42g4C' thisdict = thisbook.to_dict() #thisdict = {'embeddability': 'embeddable', 'info': '