[
  {
    "path": ".gitignore",
    "content": "__pycache__\ndist\netudier.egg-info/\nPipfile*\nbuild\nuv.lock\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "include etudier/network.html\n\n"
  },
  {
    "path": "README.md",
    "content": "![Étudier in Action](figure.gif)\n\n*étudier* is a small Python program that uses [Selenium], [requests-html] and\n[networkx] to drive a *non-headless* browser to collect a citation graph around\na particular [Google Scholar] citation or set of search results. The resulting\nnetwork is written out as [GEXF] and [GraphML] files as well as an HTML file\nthat includes a [D3] network visualization (pictured above).\n\nIf you are wondering why it uses a non-headless browser it's because Google is\n[quite protective] of this data and will routinely ask you to solve a captcha\n(identifying street signs, cars, etc in photos) to prove you are not a bot.\n*étudier* allows you to complete these captcha tasks when they occur and then it\ncontinues on its way collecting data. You need to have a browser to interact\nwith in order to do your part.\n\nInstall\n-------\n\nYou'll need to install [ChromeDriver] before doing anything else. If you use\nHomebrew on OS X this is as easy as:\n\n    brew cask install chromedriver\n\nThen you'll want to install [Python 3] and:\n\n    pip3 install etudier\n\nRun\n---\n\nTo use étudier you first need to navigate to a page on Google Scholar that you are\ninterested in, for example here is the page of citations that reference Sherry\nOrtner's [Theory in Anthropology since the Sixties]. Then you start *etudier* up\npointed at that page.\n\n    % etudier 'https://scholar.google.com/scholar?start=0&hl=en&as_sdt=20000005&sciodt=0,21&cites=17950649785549691519&scipsc='\n\nIf you are interested in starting with keyword search results in Google Scholar\nyou can do that too. For example here is the url for searching for \"cscw memory\"\nif I was interested in papers that talk about the CSCW conference and memory:\n\n    % etudier 'https://scholar.google.com/scholar?hl=en&as_sdt=0%2C21&q=cscw+memory&btnG='\n\nNote: it's important to quote the URL so that the shell doesn't interpret the\nampersands as an attempt to background the process.\n\n### --pages\n\nBy default *étudier* will collect the 10 citations on that page and then look at\nthe top 10 citations that reference each one. So you will end up with no more\nthan 100 citations being collected (10 on each page * 10 citations).\n\nIf you would like to get more than one page of results use the `--pages`. For\nexample this would result in no more than 400 (20 * 20) results being collected:\n\n    % etudier --pages 2 'https://scholar.google.com/scholar?start=0&hl=en&as_sdt=20000005&sciodt=0,21&cites=17950649785549691519&scipsc=' \n\n### --depth\n\nAnd finally if you would like to look at the citations of the citations you use the\n--depth parameter. \n\n    % etudier --depth 2 'https://scholar.google.com/scholar?start=0&hl=en&as_sdt=20000005&sciodt=0,21&cites=17950649785549691519&scipsc='\n\nThis will collect the initial set of 10 citations, the top 10 citations for\neach, and then the top 10 citations of each of those, so no more than 1000\ncitations 1000 citations (10 * 10 * 10). It's no more because there is certain\nto be some cross-citation duplication.\n\n### --output\n\nBy default `output.gexf`, `output.graphml` and `output.html` files will be\nwritten to the current working directory, but you can change this with the\n`--output` option to control the prefix that is used. The output file will\ncontain rudimentary metadata collected from Google Scholar including:\n\n- *id* - the cluster identifier assigned by Google\n- *url* - the url for the publication\n- *title* - the title of the publication\n- *authors* - a comma separated list of the publication authors\n- *year* - the year of publication\n- *cited-by* - the number of other publications that cite the publication\n- *cited-by-url* - a Google Scholar URL for the list of citing publications\n* modularity - the modularity value obtained from community detection\n\nFeatures of HTML/D3 output\n--------------------------\n\n- Node's color shows its citation group\n- Node's size shows its times being cited\n- Click node to open its source website\n- Dragable nodes\n- Zoom and pan\n- Double-click to center node\n- Resizable window\n- Text labels\n- Hover to highlight 1st-order neighborhood\n- Click and press node to fade surroundings\n\n[Theory in Anthropology since the Sixties]: https://scholar.google.com/scholar?hl=en&as_sdt=20000005&sciodt=0,21&cites=17950649785549691519&scipsc=\n[Google Scholar]: https://scholar.google.com\n[Selenium]: https://docs.seleniumhq.org/\n[requests-html]: http://html.python-requests.org/\n[quite protective]: https://www.quora.com/Are-there-technological-or-logistical-challenges-that-explain-why-Google-does-not-have-an-official-API-for-Google-Scholar\n[GEXF]: https://gephi.org/\n[GraphML]: https://networkx.org/documentation/stable/reference/readwrite/graphml.html\n[networkx]: https://networkx.github.io/\n[D3]: https://d3js.org/\n[Python 3]: https://www.python.org/downloads/\n[ChromeDriver]: https://sites.google.com/a/chromium.org/chromedriver/\n"
  },
  {
    "path": "etudier/__init__.py",
    "content": "#!/usr/bin/env python\n\nimport re\nimport sys\nimport json\nimport time\nimport random\nimport argparse\nimport networkx\nimport requests_html\n\nfrom pathlib import Path\nfrom string import Template\nfrom selenium import webdriver\nfrom selenium.common.exceptions import NoSuchElementException\nfrom selenium.webdriver.common.by import By\nfrom urllib.parse import urlparse, parse_qs\nfrom networkx.algorithms.community.modularity_max import greedy_modularity_communities\n\n\nseen = set()\ndriver = None\n\ndef main():\n    global driver\n\n    parser = argparse.ArgumentParser()\n    parser.add_argument('url', help=\"URL for a Google Scholar search to start collecting from\")\n    parser.add_argument('--depth', type=int, default=1, help=\"depth of the crawl in terms of levels of citation (defaults to 1)\")\n    parser.add_argument('--pages', type=int, default=1, help=\"breadth of the crawl in terms of number of pages of results (defaults to 1)\")\n    parser.add_argument('--output', type=str, default='output', help=\"file prefix to use for the output files (defaults to 'output')\")\n    parser.add_argument('--debug', action=\"store_true\", default=False, help=\"display diagnostics during the crawl\")\n    args = parser.parse_args()\n\n    # ready to start up headless browser\n    driver = webdriver.Chrome()\n\n    # create our graph that will get populated\n    g = networkx.DiGraph()\n\n    # iterate through all the citation links\n    for from_pub, to_pub in get_citations(args.url, depth=args.depth, pages=args.pages):\n        if args.debug:\n            print('from: %s' % json.dumps(from_pub))\n        g.add_node(from_pub['id'], label=from_pub['title'], **remove_nones(from_pub))\n        if to_pub:\n            if args.debug:\n                print('to: %s' % json.dumps(to_pub))\n            print('%s -> %s' % (from_pub['id'], to_pub['id']))\n            g.add_node(to_pub['id'], label=to_pub['title'], **remove_nones(to_pub))\n            g.add_edge(from_pub['id'], to_pub['id'])\n\n    # cluster the nodes using neighborhood detection\n    write_output(g, args)\n\n    # close the browser\n    driver.close()\n\ndef to_json(g):\n    \"\"\"\n    Source and target of links are index of corresponding nodes.\n    \"\"\"\n    j = {\"nodes\": [], \"links\": []}\n    for node_id, node_attrs in g.nodes(True):\n        node_attrs['id'] = node_id\n        j[\"nodes\"].append(node_attrs)\n    for source, target, attrs in g.edges(data=True):\n        index = 0\n        for node_id, node_attrs in g.nodes(True):\n            if source == node_id:\n                source = index\n            if target == node_id:\n                target = index\n            index += 1\n        j[\"links\"].append({\n            \"source\": source,\n            \"target\": target\n        })\n\n    return j\n\ndef cluster_nodes(g):\n    \"\"\"\n    Use Clauset-Newman-Moore greedy modularity maximization to cluster nodes.\n    \"\"\"\n    undirected_g = networkx.Graph(g)\n    for i, comm in enumerate(greedy_modularity_communities(undirected_g)):\n        for node in comm:\n            g.nodes[node]['modularity'] = i\n    return g\n\ndef get_cluster_id(url):\n    \"\"\"\n    Google assign a cluster identifier to a group of web documents\n    that appear to be the same publication in different places on the web.\n    How they do this is a bit of a mystery, but this identifier is\n    important since it uniquely identifies the publication.\n    \"\"\"\n    vals = parse_qs(urlparse(url).query).get('cluster', [])\n    if len(vals) == 1:\n        return vals[0]\n    else:\n        vals = parse_qs(urlparse(url).query).get('cites', [])\n        if len(vals) == 1:\n            return vals[0]\n    return None\n\ndef get_id(e):\n    \"\"\"\n    Determining the publication id is tricky since it involves looking\n    in the element for the various places a cluster id can show up.\n    If it can't find one it will use the data-cid which should be\n    usable since it will be a dead end anyway: Scholar doesn't know of\n    anything that cites it.\n    \"\"\"\n    for a in e.find('.gs_fl a'):\n        if 'Cited by' in a.text:\n            return get_cluster_id(a.attrs['href'])\n        elif 'versions' in a.text:\n            return get_cluster_id(a.attrs['href'])\n    return e.attrs.get('data-cid')\n\ndef get_citations(url, depth=1, pages=1):\n    \"\"\"\n    Given a page of citations it will return bibliographic information\n    for the source, target of a citation.\n    \"\"\"\n    if url in seen:\n        return\n\n    html = get_html(url)\n    seen.add(url)\n\n    # get the publication that these citations reference.\n    # Note: this can be None when starting with generic search results\n\n    a = html.find('#gs_res_ccl_top a', first=True)\n    if a:\n        to_pub = {\n            'id': get_cluster_id(url),\n            'title': a.text,\n        }\n        # try to get the total results for the item we are searching within\n        results = html.find('#gs_ab_md .gs_ab_mdw', first=True)\n        if results:\n            m = re.search('([0-9,]+) results', results.text)\n            if m:\n                to_pub['cited_by'] = int(m.group(1).replace(',', ''))\n    else:\n        to_pub = None\n\n    for e in html.find('#gs_res_ccl_mid .gs_r'):\n        from_pub = get_metadata(e, to_pub)\n        if from_pub:\n            yield from_pub, to_pub\n        else:\n            continue\n\n        # depth first search if we need to go deeper\n        if depth > 0 and from_pub['cited_by_url']:\n            yield from get_citations(\n                from_pub['cited_by_url'],\n                depth=depth-1,\n                pages=pages\n            )\n\n    # get the next page if that's what they wanted\n    if pages > 1:\n        for link in html.find('#gs_n a'):\n            if link.text == 'Next':\n                yield from get_citations(\n                    'https://scholar.google.com' + link.attrs['href'],\n                    depth=depth,\n                    pages=pages-1\n                )\n\ndef get_metadata(e, to_pub):\n    \"\"\"\n    Fetch the citation metadata from a citation element on the page.\n    \"\"\"\n    article_id = get_id(e)\n    if not article_id:\n        return None\n\n    a = e.find('.gs_rt a', first=True)\n    if a:\n        url = a.attrs['href']\n        title = a.text\n    else:\n        url = None\n        title = e.find('.gs_rt .gs_ctu', first=True).text\n\n    authors = source = website = None\n    meta = e.find('.gs_a', first=True).text\n    meta_parts = [m.strip() for m in re.split(r'\\W-\\W', meta)]\n    if len(meta_parts) == 3:\n        authors, source, website = meta_parts\n    elif len(meta_parts) == 2:\n        authors, source = meta_parts\n\n    if source and ',' in source:\n        year = source.split(',')[-1].strip()\n    else:\n        year = source\n\n    cited_by = cited_by_url = None\n    for a in e.find('.gs_fl a'):\n        if 'Cited by' in a.text:\n            cited_by = a.search('Cited by {:d}')[0]\n            cited_by_url = 'https://scholar.google.com' + a.attrs['href']\n\n    return {\n        'id': article_id,\n        'url': url,\n        'title': title,\n        'authors': authors,\n        'year': year,\n        'cited_by': cited_by,\n        'cited_by_url': cited_by_url,\n    }\n\ndef get_html(url):\n    \"\"\"\n    get_html uses selenium to drive a browser to fetch a URL, and return a\n    requests_html.HTML object for it.\n    \n    If there is a captcha challenge it will alert the user and wait until \n    it has been completed.\n    \"\"\"\n    global driver\n\n    if driver is None:\n        raise Exception(\"driver is not configured!\")\n\n    time.sleep(random.randint(1,5))\n    driver.get(url)\n    while True:\n        try:\n            driver.find_element(By.CSS_SELECTOR, '#gs_captcha_ccl,#recaptcha')\n        except NoSuchElementException:\n\n            try:\n                html = driver.find_element(By.CSS_SELECTOR,'#gs_top').get_attribute('innerHTML')\n                return requests_html.HTML(html=html)\n            except NoSuchElementException:\n                print(\"google has blocked this browser, reopening\")\n                driver.close()\n                driver = webdriver.Chrome()\n                return get_html(url)\n\n        print(\"... it's CAPTCHA time!\\a ...\")\n        time.sleep(5)\n\ndef remove_nones(d):\n    new_d = {}\n    for k, v in d.items():\n        if v is not None:\n            new_d[k] = v\n    return new_d\n\ndef write_output(g, args):\n    cluster_nodes(g)\n    networkx.write_gexf(g, '%s.gexf' % args.output)\n    networkx.write_graphml(g, '%s.graphml' % args.output)\n    write_html(g, '%s.html' % args.output)\n\ndef write_html(g, output):\n    graph_json = json.dumps(to_json(g), indent=2)\n    html_file = Path(__file__).parent / \"network.html\"\n    opts = ' '.join(sys.argv[1:])\n    tmpl = Template(html_file.open().read())\n    html = tmpl.substitute({\n        \"__OPTIONS__\": opts,\n        \"__GRAPH_JSON__\": graph_json\n    })\n    Path(output).open('w').write(html)\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "etudier/network.html",
    "content": "<!DOCTYPE html>\n\n<!--\n\nThis Google Scholar network visualization was generated with\nhttps://github.com/edsu/etudier using the following command:\n\n% etudier $__OPTIONS__\n\n--> \n\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <style>\n      body {\n        overflow: hidden;\n        margin: 0;\n      }\n\n      text {\n        font-family: sans-serif;\n        pointer-events: none;\n      }\n    </style>\n  </head>\n\n  <body>\n    <script src=\"https://d3js.org/d3.v3.min.js\"></script>\n    <script>\n      var graph = $__GRAPH_JSON__;\n      var w = window.innerWidth;\n      var h = window.innerHeight;\n\n      var focusNode = null;\n      var highlightNode = null;\n\n      var textCenter = false;\n      var outline = false;\n\n      var minScore = Math.min(...graph.nodes.map(n => n.modularity));\n      var maxScore = Math.max(...graph.nodes.map(n => n.modularity));\n\n      var color = d3.scale\n        .linear()\n        .domain([\n          minScore,\n          (minScore + maxScore) / 4,\n          (minScore + maxScore) / 2,\n          ((minScore + maxScore) * 3) / 4,\n          maxScore,\n        ])\n        .range([\"lime\", \"yellow\", \"red\", \"deepskyblue\"]);\n\n      var highlightColor = \"blue\";\n      var highlightTrans = 0.1;\n\n      const citedBy = graph.nodes\n        .map(n => n.cited_by)\n        .filter(n => n != null)\n\n      const maxCitedBy = Math.max(...citedBy)\n      const minCitedBy = Math.min(...citedBy)\n\n      var size = d3.scale\n        .pow()\n        .exponent(1)\n        .domain([minCitedBy, maxCitedBy])\n        .range([8, 24]);\n\n      var force = d3.layout\n        .force()\n        .linkDistance(h / (graph.nodes.length / 10))\n        .charge(-300)\n        .size([w, h]);\n\n      var defaultNodeColor = \"#ccc\";\n      var defaultLinkColor = \"#888\";\n      var nominalBaseNodeSize = 8;\n      var nominalTextSize = 10;\n      var maxTextSize = 24;\n      var nominalStroke = 1.5;\n      var maxStroke = 4.5;\n      var maxBaseNodeSize = 36;\n      var minZoom = 0.1;\n      var maxZoom = 7;\n      var svg = d3.select(\"body\").append(\"svg\");\n      var zoom = d3.behavior.zoom().scaleExtent([minZoom, maxZoom]);\n      var g = svg.append(\"g\");\n      svg.style(\"cursor\", \"move\");\n\n      var linkedByIndex = {};\n      graph.links.forEach(function (d) {\n        linkedByIndex[d.source + \",\" + d.target] = true;\n      });\n\n      function isConnected(a, b) {\n        return (\n          linkedByIndex[a.index + \",\" + b.index] ||\n          linkedByIndex[b.index + \",\" + a.index] ||\n          a.index == b.index\n        );\n      }\n\n      force.size([w, h]);\n\n      force\n        .nodes(graph.nodes)\n        .links(graph.links)\n        .start();\n\n      function getLine(data) {\n\n        const x1 = data.source.x;\n        const y1= data.source.y;\n        const x2 = data.target.x;\n        const y2 = data.target.y;\n\n        const r = size(data.target.cited_by) + 1;\n\n        const m = (y2 - y1) / (x2 - x1);\n        const b = y1 - m * x1;\n\n        const c = Math.sqrt(Math.pow((y2 - y1), 2) + Math.pow((x2 - x1), 2))\n        const a = y2 - y1\n        const cos = a / c\n\n        const a2 = cos * r\n        const b2 = Math.sqrt(Math.pow(r, 2) - Math.pow(a2, 2))\n\n        const x = x2 > x1 ? x2 - b2 : x2 + b2;\n        const y = y2 - a2;\n\n        const path = 'M ' + data.source.x + ',' + data.source.y + ' L ' + x + ',' + y;\n        return path;\n      }\n\n      var link = g\n        .selectAll(\".link\")\n        .data(graph.links)\n        .enter()\n        .append(\"svg:path\")\n        .attr(\"d\", getLine) \n        .attr(\"stroke\", defaultLinkColor)\n        .attr(\"fill\", \"red\")\n        .style(\"stroke-width\", nominalStroke)\n        .style(\"marker-end\", \"url(#end)\")\n\n      var node = g\n        .selectAll(\".node\")\n        .data(graph.nodes)\n        .enter()\n        .append(\"g\")\n        .attr(\"class\", \"node\")\n        .call(force.drag);\n\n      var timeout = null;\n\n      node.on(\"dblclick\", function (d) {\n        clearTimeout(timeout);\n\n        timeout = setTimeout(function () {\n          window.open(d.url, \"_blank\");\n          d3.event.stopPropagation();\n        }, 300);\n      });\n\n      var tocolor = \"fill\";\n      var towhite = \"stroke\";\n      if (outline) {\n        tocolor = \"stroke\";\n        towhite = \"fill\";\n      }\n\n      var circle = node\n        .append(\"path\")\n        .attr(\n          \"d\",\n          d3.svg\n            .symbol()\n            .size(function (d) {\n              return (\n                Math.PI * Math.pow(size(d.cited_by) || nominalBaseNodeSize, 2)\n              );\n            })\n            .type(function (d) {\n              return d.type;\n            })\n        )\n        .style(tocolor, function (d) {\n          if (isNumber(d.modularity) && d.modularity >= 0) return color(d.modularity);\n          else return defaultNodeColor;\n        })\n        .style(\"stroke-width\", nominalStroke)\n        .style(towhite, \"white\");\n\n      svg.append(\"svg:defs\").selectAll(\"marker\")\n\t  .data([\"end\"])\n\t.enter().append(\"svg:marker\")\n\t  .attr(\"id\", String)\n\t  .attr(\"viewBox\", \"0 -5 10 10\")\n\t  .attr(\"refX\", 10)\n\t  .attr(\"refY\", 0)\n\t  .attr(\"markerWidth\", 6)\n\t  .attr(\"markerHeight\", 6)\n\t  .attr(\"orient\", \"auto\")\n          .style(\"fill\", defaultLinkColor)\n\t.append(\"svg:path\")\n\t  .attr(\"d\", \"M 0,-5 L 10,0 L 0,5\")\n          .style(\"stroke\", defaultLinkColor);\n\n      var text = g\n        .selectAll(\".text\")\n        .data(graph.nodes)\n        .enter()\n        .append(\"text\")\n        .attr(\"dy\", \".35em\")\n        .style(\"font-size\", nominalTextSize + \"px\");\n\n      node\n        .on(\"mouseover\", function (d) {\n          setHighlight(d);\n        })\n        .on(\"mousedown\", function (d) {\n          d3.event.stopPropagation();\n          focusNode = d;\n          setFocus(d);\n          if (highlightNode === null) setHighlight(d);\n        })\n        .on(\"mouseout\", function (d) {\n          exitHighlight();\n        });\n\n      d3.select(window).on(\"mouseup\", function () {\n        if (focusNode !== null) {\n          focusNode = null;\n          if (highlightTrans < 1) {\n            circle.style(\"opacity\", 1);\n            text.style(\"opacity\", 1);\n            link.style(\"opacity\", 1);\n          }\n        }\n\n        if (highlightNode === null) exitHighlight();\n      });\n\n      function exitHighlight() {\n        highlightNode = null;\n        if (focusNode === null) {\n          svg.style(\"cursor\", \"move\");\n          if (highlightColor != \"white\") {\n            circle.style(towhite, \"white\");\n            text.text('')\n            link.style(\"stroke\", function (o) {\n              return isNumber(o.score) && o.score >= 0\n                ? color(o.score)\n                : defaultLinkColor;\n            });\n          }\n        }\n      }\n\n      function setFocus(d) {\n        if (highlightTrans < 1) {\n          circle.style(\"opacity\", function (o) {\n            return isConnected(d, o) ? 1 : highlightTrans;\n          });\n\n          text.style(\"opacity\", function (o) {\n            return isConnected(d, o) ? 1 : highlightTrans;\n          });\n\n          link.style(\"opacity\", function (o) {\n            return o.source.index == d.index || o.target.index == d.index\n              ? 1\n              : highlightTrans;\n          });\n        }\n      }\n\n      function setHighlight(d) {\n        svg.style(\"cursor\", \"pointer\");\n        if (focusNode !== null) d = focusNode;\n        highlightNode = d;\n\n        if (highlightColor != \"white\") {\n\n          circle.style(towhite, function (o) {\n            return isConnected(d, o) ? highlightColor : \"white\";\n          });\n          \n          text.attr(\"dx\", function (d) {\n            return size(d.cited_by)\n          });\n\n          text.text(function (o) {\n            if (isConnected(d, o)) {\n              let title = o.title;\n              if (o.year) title = title + \" (\" + o.year + \")\";\n              if (o.authors) title = title + \" - \" + o.authors;\n              return title\n            } else {\n              return \"\"\n            }\n          });\n\n        }\n      }\n\n      zoom.on(\"zoom\", function () {\n        var stroke = nominalStroke;\n        if (nominalStroke * zoom.scale() > maxStroke)\n          stroke = maxStroke / zoom.scale();\n        link.style(\"stroke-width\", stroke);\n        circle.style(\"stroke-width\", stroke);\n\n        var baseRadius = nominalBaseNodeSize;\n        if (nominalBaseNodeSize * zoom.scale() > maxBaseNodeSize)\n          baseRadius = maxBaseNodeSize / zoom.scale();\n        circle.attr(\n          \"d\",\n          d3.svg\n            .symbol()\n            .size(function (d) {\n              return (\n                Math.PI *\n                Math.pow(\n                  (size(d.cited_by) * baseRadius) / nominalBaseNodeSize ||\n                    baseRadius,\n                  2\n                )\n              );\n            })\n        );\n\n        if (!textCenter)\n          text.attr(\"dx\", function (d) {\n            return (\n              (size(d.cited_by) * baseRadius) / nominalBaseNodeSize ||\n              baseRadius\n            );\n          });\n\n        var textSize = nominalTextSize;\n        if (nominalTextSize * zoom.scale() > maxTextSize)\n          textSize = maxTextSize / zoom.scale();\n        text.style(\"font-size\", textSize + \"px\");\n\n        g.attr(\n          \"transform\",\n          \"translate(\" + d3.event.translate + \")scale(\" + d3.event.scale + \")\"\n        );\n      });\n\n      svg.call(zoom);\n\n      resize();\n      d3.select(window).on(\"resize\", resize);\n\n      force.on(\"tick\", function () {\n        node.attr(\"transform\", function (d) {\n          return \"translate(\" + d.x + \",\" + d.y + \")\";\n        });\n        text.attr(\"transform\", function (d) {\n          return \"translate(\" + d.x + \",\" + d.y + \")\";\n        });\n\n        link.attr(\"d\", getLine)\n\n        node\n          .attr(\"cx\", function (d) {\n            return d.x;\n          })\n          .attr(\"cy\", function (d) {\n            return d.y;\n          });\n      });\n\n      function resize() {\n        var width = window.innerWidth,\n          height = window.innerHeight;\n        svg.attr(\"width\", width).attr(\"height\", height);\n\n        force\n          .size([\n            force.size()[0] + (width - w) / zoom.scale(),\n            force.size()[1] + (height - h) / zoom.scale(),\n          ])\n          .resume();\n        w = width;\n        h = height;\n      }\n\n      function isNumber(n) {\n        return !isNaN(parseFloat(n)) && isFinite(n);\n      }\n\n    </script>\n  </body>\n</html>\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[project]\nname = \"etudier\"\nversion = \"0.2.1\"\ndescription = \"Collect a citation graph from Google Scholar\"\nauthors = [{name = \"Ed Summers\", email = \"ehs@pobox.com\"}]\nreadme = \"README.md\"\nrequires-python = \">=3.8\"\ndependencies = [\n    \"selenium>=4.7\",\n    \"requests>=2.28\",\n    \"requests-html>=0.10\",\n    \"networkx>=2.8\",\n    \"lxml-html-clean>=0.3.1\",\n]\n\n[project.scripts]\netudier = \"etudier:main\"\n\n[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n"
  }
]