Commit 17c7d67f authored by onbpre's avatar onbpre

histogram search prototype

parent 89f62c55
requests>=2.0
jupyter>=1.0
plotly>=1.9.0
\ No newline at end of file
jupyter>=1.0
\ No newline at end of file
......@@ -8,24 +8,13 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import plotly.offline as py\n",
"import plotly.graph_objs as go\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"from webarchiv import WebarchivSession\n",
"apikey = 'Zz2tQls7fuaocX2pjrfc2npojqbGwXL2'\n",
"apikey = '2pm8i0hnmpcTK4Oj4CUeBoZd7vywrm4c'\n",
"w = WebarchivSession(apikey)"
]
},
......@@ -38,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
......@@ -54,7 +43,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
......@@ -79,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"outputs": [
{
......@@ -97,25 +86,6 @@
" x.append(period['period'])\n",
" y.append(period['total'])\n",
" \n",
"trace0 = go.Bar(\n",
" x=x,\n",
" y=y,\n",
" name='Anzahl Captures mit \"situationselastisch\"',\n",
" marker=dict(\n",
" color='rgb(49,130,189)'\n",
" )\n",
")\n",
"\n",
"data = [trace0]\n",
"layout = go.Layout(\n",
" xaxis=dict(tickangle=-45),\n",
" barmode='group',\n",
")\n",
"\n",
"fig = go.Figure(data=data, layout=layout)\n",
"py.iplot(fig, filename='angled-text-bar')\n",
"\n",
"\n",
"print(x)\n",
"print(y)\n"
]
......
......@@ -24,9 +24,8 @@ class WebarchivSession:
Protocol, domain and path prefix for the Webarchive API,
with a single positional format string placeholder
for the REST operation and parameters.
return 'https://webarchiv.onb.ac.at/api/{}'
"""
return 'http://192.168.1.202:8080/webarchive_web/api/{}'
return 'https://webarchiv.onb.ac.at/api/{}'
@property
def _error_template(self):
......@@ -245,7 +244,7 @@ if __name__ == '__main__':
# noinspection SpellCheckingInspection
w = WebarchivSession('2pm8i0hnmpcTK4Oj4CUeBoZd7vywrm4c')
# response = w.wayback_search("http://www.onb.ac.at")
#response = w.wayback_search("http://frauenhetz.jetzt")
# response = w.wayback_search("http://frauenhetz.jetzt")
response = w.histogram_search("Nationalbibliothek Prunksaal Schwarzenegger")
# response = w.wayback_search("x")
......
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