Commit 76d049ae authored by Andreas's avatar Andreas
parent a9907fda
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Create a WebarchivSession Object with convenience methods for easy access with your API-Key "
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from webarchiv import WebarchivSession\n",
"\n",
"apikey = '2pm8i0hnmpcTK4Oj4CUeBoZd7vywrm4c'\n",
"w = WebarchivSession(apikey)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Submit a URL search to get all archived capturedates of the requested URL"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"183 captures of http://www.onb.ac.at in https://webarchiv.onb.ac.at in 2012\n"
]
}
],
"source": [
"url = \"http://www.onb.ac.at\"\n",
"mode = 1 # search in https://webarchiv.onb.ac.at\n",
"response = w.wayback_search(url, \"201201\", \"201212\", mode)\n",
"if response.status_code != 200:\n",
" print(\"Something went wrong ...\")\n",
" exit(1)\n",
"\n",
"print(\"{} captures of {} in https://webarchiv.onb.ac.at in 2012\".format(response.json()['total'], url)) \n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"58 captures of http://www.onb.ac.at in https://archive.org/web/ in 2012\n"
]
}
],
"source": [
"mode = 2 # search in https://archive.org/web/\n",
"response = w.wayback_search(url, \"201201\", \"201212\", mode)\n",
"if response.status_code != 200:\n",
" print(\"Something went wrong ...\")\n",
" exit(1)\n",
"\n",
"print(\"{} captures of {} in https://archive.org/web/ in 2012\".format(response.json()['total'], url)) \n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"241 captures of http://www.onb.ac.at in https://webarchiv.onb.ac.at and https://archive.org/web/ in 2012\n"
]
}
],
"source": [
"mode = 3 # search in https://webarchiv.onb.ac.at and https://archive.org/web/\n",
"response = w.wayback_search(url, \"201201\", \"201212\", mode)\n",
"if response.status_code != 200:\n",
" print(\"Something went wrong ...\")\n",
" exit(1)\n",
"\n",
"print(\"{} captures of {} in https://webarchiv.onb.ac.at and https://archive.org/web/ in 2012\".format(response.json()['total'], url)) \n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"https://webarchiv.onb.ac.at/web/20120102200024/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120103030030/http://www.onb.ac.at\nhttps://web.archive.org/web/20120103085656/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120103111057/http://www.onb.ac.at\nhttps://web.archive.org/web/20120104004609/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120104030249/http://www.onb.ac.at\nhttps://web.archive.org/web/20120104033812/http://www.onb.ac.at\nhttps://web.archive.org/web/20120104053431/http://www.onb.ac.at\nhttps://web.archive.org/web/20120104172544/http://www.onb.ac.at\nhttps://web.archive.org/web/20120104211139/http://www.onb.ac.at\nhttps://web.archive.org/web/20120105024937/http://www.onb.ac.at\nhttps://web.archive.org/web/20120105045021/http://www.onb.ac.at\nhttps://web.archive.org/web/20120105062305/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120106173115/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120107071626/http://www.onb.ac.at\nhttps://web.archive.org/web/20120107124209/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120107222032/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120108150220/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120109024041/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120109053408/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120109213601/http://www.onb.ac.at\nhttps://web.archive.org/web/20120111115903/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120111142045/http://www.onb.ac.at\nhttps://web.archive.org/web/20120111153905/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120111214314/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120115020930/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120119215212/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120123015135/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120123063430/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120123200028/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120125020014/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120125114654/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120125182809/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120127061707/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120128202352/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120129003018/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120130030118/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120130201431/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120201152355/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120203110715/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120203142556/http://www.onb.ac.at\nhttps://web.archive.org/web/20120204095605/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120204210213/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120206200038/http://www.onb.ac.at\nhttps://web.archive.org/web/20120211025348/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120214015504/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120214165340/http://www.onb.ac.at\nhttps://web.archive.org/web/20120215084847/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120220081221/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120220135313/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120220200111/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120223122327/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120224055528/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120225101446/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120228102713/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120228201936/http://www.onb.ac.at\nhttps://web.archive.org/web/20120302101009/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120302111027/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120303110308/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120303150554/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120304200500/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120305200041/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120305210225/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120309000724/http://www.onb.ac.at\nhttps://web.archive.org/web/20120311171714/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120312200125/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120313124328/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120316235528/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120317101350/http://www.onb.ac.at\nhttps://web.archive.org/web/20120317141157/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120318125830/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120318143729/http://www.onb.ac.at\nhttps://web.archive.org/web/20120319092448/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120319200103/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120322153218/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120324124229/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120324222819/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120326190105/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120327002658/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120329011410/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120329135512/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120401015112/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120402233632/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120403084355/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120403100239/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120404055908/http://www.onb.ac.at\nhttps://web.archive.org/web/20120404220110/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120405064534/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120406045723/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120407031330/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120407111751/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120408154600/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120409190012/http://www.onb.ac.at\nhttps://web.archive.org/web/20120411131244/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120416163334/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120416190114/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120418190601/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120420023139/http://www.onb.ac.at\nhttps://web.archive.org/web/20120421023215/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120422070724/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120422153646/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120423190110/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120424023451/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120424072452/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120425012856/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120429074745/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120430190117/http://www.onb.ac.at\nhttps://web.archive.org/web/20120501180544/http://www.onb.ac.at\nhttps://web.archive.org/web/20120501194813/http://www.onb.ac.at\nhttps://web.archive.org/web/20120502000534/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120503100245/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120504003709/http://www.onb.ac.at\nhttps://web.archive.org/web/20120504142825/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120505040426/http://www.onb.ac.at\nhttps://web.archive.org/web/20120505174602/http://www.onb.ac.at\nhttps://web.archive.org/web/20120507071553/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120507190117/http://www.onb.ac.at\nhttps://web.archive.org/web/20120513052129/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120514190122/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120521190107/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120528190114/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120603100120/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120603191752/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120604190108/http://www.onb.ac.at\nhttps://web.archive.org/web/20120608023051/http://www.onb.ac.at\nhttps://web.archive.org/web/20120611071146/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120611190110/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120618190104/http://www.onb.ac.at\nhttps://web.archive.org/web/20120619092455/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120625190106/http://www.onb.ac.at\nhttps://web.archive.org/web/20120701104616/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120702190122/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120703100138/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120703192416/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120709190108/http://www.onb.ac.at\nhttps://web.archive.org/web/20120712042942/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120716190129/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120723190108/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120730190048/http://www.onb.ac.at\nhttps://web.archive.org/web/20120803034553/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120803100107/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120803195245/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120806190048/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807112118/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807162717/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807171008/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807194619/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807214755/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807221023/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120807225453/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808025611/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808025618/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808032419/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808050025/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808060942/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808085319/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808093035/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808094030/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808094834/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808104034/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120808113145/http://www.onb.ac.at\nhttps://web.archive.org/web/20120811041311/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120813190048/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120821093023/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120821174107/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120821181247/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120821215211/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120821223057/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120824112018/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120824182734/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120824192549/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120824194753/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120824232844/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120825011726/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120825013148/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120825014902/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120825020350/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120825033853/http://www.onb.ac.at\nhttps://web.archive.org/web/20120825151313/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120825153556/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120826084626/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120827190126/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120904120314/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120904140137/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120905001154/http://www.onb.ac.at\nhttps://web.archive.org/web/20120910165233/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120910190100/http://www.onb.ac.at\nhttps://web.archive.org/web/20120911073929/http://www.onb.ac.at\nhttps://web.archive.org/web/20120914211343/http://www.onb.ac.at\nhttps://web.archive.org/web/20120914233655/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120917190056/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120918210441/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120918222544/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120918224804/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120918225150/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120918234923/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120919001203/http://www.onb.ac.at\nhttps://web.archive.org/web/20120919095503/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120919175641/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120920083126/http://www.onb.ac.at\nhttps://web.archive.org/web/20120920180744/http://www.onb.ac.at\nhttps://web.archive.org/web/20120922083907/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120924190057/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120927003137/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120927035612/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120927055949/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20120927222844/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121002101040/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121003100123/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121003234252/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121008190058/http://www.onb.ac.at\nhttps://web.archive.org/web/20121010210631/http://www.onb.ac.at\nhttps://web.archive.org/web/20121011224753/http://www.onb.ac.at\nhttps://web.archive.org/web/20121014203406/http://www.onb.ac.at\nhttps://web.archive.org/web/20121015153426/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121015190047/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121022190045/http://www.onb.ac.at\nhttps://web.archive.org/web/20121025025627/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121029200047/http://www.onb.ac.at\nhttps://web.archive.org/web/20121031040217/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121103110116/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121103224547/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121105200048/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121112200047/http://www.onb.ac.at\nhttps://web.archive.org/web/20121113045431/http://www.onb.ac.at\nhttps://web.archive.org/web/20121117112104/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121119200034/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121126200034/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121203110052/http://www.onb.ac.at\nhttps://web.archive.org/web/20121203133616/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121203200036/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121203223503/http://www.onb.ac.at\nhttps://web.archive.org/web/20121206185917/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121210200034/http://www.onb.ac.at\nhttps://web.archive.org/web/20121211165612/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121217200034/http://www.onb.ac.at\nhttps://web.archive.org/web/20121219101007/http://www.onb.ac.at\nhttps://web.archive.org/web/20121220085106/http://www.onb.ac.at\nhttps://web.archive.org/web/20121221183512/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121224200031/http://www.onb.ac.at\nhttps://webarchiv.onb.ac.at/web/20121231200039/http://www.onb.ac.at\n"
]
}
],
"source": [
"for hit in response.json()['hits']:\n",
" captureurl = 'https://webarchiv.onb.ac.at/web/' \n",
" if hit['r'] == 4:\n",
" captureurl = 'https://web.archive.org/web/'\n",
" \n",
" captureurl = captureurl + hit['c'] + '/' + url\n",
" print(captureurl)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
......@@ -17,6 +17,11 @@ POSITIONLEN_MODE = 1
POSITION_MODE = 2
REGEX_MODE = 3
# searchmodes
SEARCHMODE_WEBARCHIV = 1
SEARCHMODE_INTERNETARCHIVE = 2
SEARCHMODE_WEBARCHIV_INTERNETARCHIVE = 3
class SessionTimeoutError(Exception):
pass
......@@ -228,7 +233,7 @@ class WebarchivSession:
except HTTPError as e:
self._display_http_error(e)
def wayback_search(self, query_string, from_=None, to_=None):
def wayback_search(self, query_string, from_=None, to_=None, mode_=SEARCHMODE_WEBARCHIV):
"""
Start a wayback search query in the Webarchive.
......@@ -245,6 +250,8 @@ class WebarchivSession:
if to_:
params['to'] = to_
params['mode'] = mode_
try:
response = self._get(op='/search/wayback', params=params)
return self.wait_for_response(response)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment