sample1.ipynb 7.71 KB
Newer Older
Andreas's avatar
Andreas committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "import necessary modules"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "import json\n",
    "import time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "load metadata files from Webarchive Austria"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "\n",
    "selective_crawls = requests.get('https://webarchiv.onb.ac.at/data/selective.json').json()\n",
    "event_crawls = requests.get('https://webarchiv.onb.ac.at/data/events.json').json()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now you can extract metadata from these files"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show the names and dates of all crawls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Andreas's avatar
Andreas committed
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
      "Selective Crawls\n",
      "\n",
      "Frau/Gender\n",
      "Politikkollektion\n",
      "Medienkollektion\n",
      "\n",
      "Event Crawls\n",
      "\n",
      "100 Jahre Republik 2018\n",
      "EU-Ratsvorsitz 2018\n",
      "Bundespräsidenten-Wahl 2016\n",
      "Flüchtlingskrise 2015\n",
      "Song Contest 2015\n",
      "Erster Weltkrieg 2014\n",
      "EU-Wahl 2014\n",
      "Olympia 2014\n",
      "Olympia 2010\n",
      "Bundespräsidenten-Wahl 2010\n",
      "EU-Wahl 2009\n"
Andreas's avatar
Andreas committed
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
     ]
    }
   ],
   "source": [
    "print('Selective Crawls\\n')\n",
    "for crawl in selective_crawls:\n",
    "    print(crawl['name'])\n",
    "print('\\nEvent Crawls\\n')\n",
    "for crawl in event_crawls:\n",
    "    print(crawl['name'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Show all seeds of Song Contest 2015 event"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
Andreas's avatar
Andreas committed
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
      "http://conchitawurst.com\n",
      "http://conchitawurst.com/news/\n",
      "http://de.wikipedia.org/wiki/Eurovision_Song_Contest_2015\n",
      "http://de.wikipedia.org/wiki/The_Makemakes\n",
      "http://debatte.orf.at/stories/1754300/\n",
      "http://derstandard.at/r2000004087668/Song-Contest-2015\n",
      "http://derstandard.at/r2000015639396/Eurovisions---Song-Contest-Blog\n",
      "http://diepresse.com/home/kultur/songcontest/index.do\n",
      "http://goodnight.at/magazin/kultur/516-60-eurovision-songcontest-in-wien\n",
      "http://kundendienst.orf.at/programm/fernsehen/orf1/songcontest2015.html\n",
      "http://kurier.at/kultur/song-contest\n",
      "http://medienportal.univie.ac.at/uniview/forschung/detailansicht/artikel/song-contest-zwischen-pop-und-politik/\n",
      "http://oe3.orf.at/stories/2679710\n",
      "http://orf.at/\n",
      "http://orf.at/stories/2254095/\n",
      "http://orf.at/stories/2254095/2254088/\n",
      "http://orf.at/stories/2254095/2254098/\n",
      "http://songcontest.orf.at/\n",
      "http://steiermark.orf.at/news/stories/2684488/\n",
      "http://tvthek.orf.at/topic/Eurovision-Song-Contest-2015/9137507\n",
      "http://tvthek.orf.at/topic/Oesterreich-beim-Song-Contest/9174892\n",
      "http://wien.orf.at/news/stories/2648040/\n",
      "http://wien.orf.at/news/stories/2648857/\n",
      "http://wien.orf.at/news/stories/2649515/\n",
      "http://wien.orf.at/news/stories/2661128/\n",
      "http://wien.orf.at/news/stories/2661370/\n",
      "http://wien.orf.at/news/stories/2661798/\n",
      "http://wien.orf.at/news/stories/2661804/\n",
      "http://wien.orf.at/news/stories/2661845/\n",
      "http://wien.orf.at/news/stories/2661855/\n",
      "http://wien.orf.at/news/stories/2661910/\n",
      "http://wien.orf.at/news/stories/2662093/\n",
      "http://wien.orf.at/news/stories/2662947/\n",
      "http://wien.orf.at/news/stories/2663106/\n",
      "http://wien.orf.at/news/stories/2664083/\n",
      "http://wien.orf.at/news/stories/2666541/\n",
      "http://wien.orf.at/news/stories/2666581/\n",
      "http://wien.orf.at/news/stories/2668462/\n",
      "http://wien.orf.at/news/stories/2670490/\n",
      "http://wien.orf.at/news/stories/2676170/\n",
      "http://wien.orf.at/news/stories/2678309/\n",
      "http://wien.orf.at/news/stories/2679672/\n",
      "http://wien.orf.at/news/stories/2680454/\n",
      "http://wien.orf.at/news/stories/2682245/\n",
      "http://wien.orf.at/news/stories/2683703/\n",
      "http://wien.orf.at/news/stories/2684423/\n",
      "http://wien.orf.at/news/stories/2687164/\n",
      "http://wien.orf.at/news/stories/2706977/\n",
      "http://wien.orf.at/news/tags/esc\n",
      "http://www.apa.at/Site/ESC2015/index.html\n",
      "http://www.austria-trend.at/blog/\n",
      "http://www.bmlfuw.gv.at/umwelt/nachhaltigkeit/green-events/projekte/kultur_und_musik/green_song_contest.html\n",
      "http://www.eurovision.tv/\n",
      "http://www.heute.at/song+contest./\n",
      "http://www.krone.at/song-contest\n",
      "http://www.news.at/a/song-contest-telegramm-2015\n",
      "http://www.oe24.at/kultur/song-contest\n",
      "http://www.oeticket.com/de/kuenstler/eurovision-song-contest-1020/profile.html\n",
      "http://www.picturedesk.com/ESC2015\n",
      "http://www.railtours.at/sonderangebote/oesterreich/wien/eurovision-song-contest-2015\n",
      "http://www.railtours.at/sonderangebote/oesterreich/wien/eurovision-song-contest-2015-family-show-finale.html\n",
      "http://www.railtours.at/sonderangebote/oesterreich/wien/eurovision-song-contest-2015-jury-show-finale.html\n",
      "http://www.railtours.at/sonderangebote/oesterreich/wien/eurovision-song-contest-2015-public-viewing-in-wien.html\n",
      "http://www.railtours.at/sonderangebote/oesterreich/wien/eurovision-song-contest-2015-semifinale-1-2.html\n",
      "http://www.songcontest.at/\n",
      "http://www.stadthalle.com/de/schauen/events/75/Eurovision-Song-Contest\n",
      "http://www.vienna.at/specials/eurovision-song-contest\n",
      "http://www.wien-event.at/events/song-contest/\n",
      "http://www.wien-ticket.at/de/service/Eurovision-Song-Contest-Wiener-Stadthalle-Wien\n",
      "http://www.wien.info/de/musik-buehne/eurovision-song-contest\n",
      "http://www.wienerlinien.at/eportal2/ep/tab.do/pageTypeId/74690\n",
      "http://www.wienerzeitung.at/dossiers/eurovision_song_contest_2015/\n",
      "https://instagram.com/esc_buildingbridges/\n",
      "https://instagram.com/themakemakes/\n",
      "https://twitter.com/ESC2015ORF\n",
      "https://twitter.com/Eurovision\n",
      "https://twitter.com/hashtag/eurovision?src=hash\n",
      "https://www.facebook.com/ESCBuildingBridges\n",
      "https://www.facebook.com/EurovisionSongContest\n",
      "https://www.facebook.com/themakemakes\n",
      "https://www.stadthalle.com/de/schauen/events/75/Eurovision-Song-Contest\n",
      "https://www.wien.gv.at/kultur/esc/\n"
Andreas's avatar
Andreas committed
193 194 195 196 197 198 199 200 201 202 203 204 205 206
     ]
    }
   ],
   "source": [
    "for crawl in event_crawls:\n",
    "    if crawl['name'] == 'Song Contest 2015':\n",
    "        for group in crawl['groups']:\n",
    "            for seed in group['seeds']:\n",
    "                print(seed)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
Andreas's avatar
Andreas committed
207
   "display_name": "Python 3",
Andreas's avatar
Andreas committed
208
   "language": "python",
Andreas's avatar
Andreas committed
209
   "name": "python3"
Andreas's avatar
Andreas committed
210 211 212 213
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
Andreas's avatar
Andreas committed
214
    "version": 3
Andreas's avatar
Andreas committed
215 216 217 218 219
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
Andreas's avatar
Andreas committed
220 221
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
Andreas's avatar
Andreas committed
222 223 224
  }
 },
 "nbformat": 4,
Andreas's avatar
Andreas committed
225
 "nbformat_minor": 1
Andreas's avatar
Andreas committed
226
}