{"id":6313,"date":"2019-09-13T12:05:11","date_gmt":"2019-09-13T11:05:11","guid":{"rendered":"http:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/?p=6313"},"modified":"2019-10-18T15:19:39","modified_gmt":"2019-10-18T14:19:39","slug":"exporting-web-links-from-weblearn-resources","status":"publish","type":"post","link":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/2019\/09\/exporting-web-links-from-weblearn-resources\/","title":{"rendered":"Exporting Web Links from WebLearn (Resources)"},"content":{"rendered":"<p>Web Links, which are items in Resources which, when clicked, redirect the user to a specific web page. In general, these are external web sites but could also be links to pages or documents stored in WebLearn.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6322\" src=\"http:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/wl.png\" alt=\"\" width=\"285\" height=\"89\" \/><\/p>\n<p>Web Links are not included when exporting the whole site (Site Info &gt; Export Site), however, you can use the following Unix command line script to automatically generate a web page containing all Web Links in a particular site. (You must make sure all folders containing WebLinks (in Resources) are available to the Public. To do this, select Edit Details alongside the desired folders and set to public visibility.)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6319\" src=\"http:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/pubberlick-1.png\" alt=\"\" width=\"570\" height=\"285\" srcset=\"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/pubberlick-1.png 570w, https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/pubberlick-1-300x150.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><br \/>\nThat script again<\/p>\n<pre>\r\n#!\/bin\/sh\r\nif [ \"$#\" -ne 1 ] ; then\r\n  echo \"Usage: weblinks2html WebLearn-URL, for example, weblinks2html https:\/\/weblearn.ox.ac.uk\/direct\/content\/site\/[[siteid]].json\" &gt;&amp;2\r\nelse \r\n  # assumes the web file has public access\r\n  curl $1 &gt; json\r\n  cat json | grep -e \\\\.URL\\\" -e entityTitle  |\\\r\n  sed -e 's\/\"entityTitle\": \"\/echo \\\\\\\"\"&gt;\/g' -e 's\/\"$\/&lt;\\\/a&gt;&lt;\\\/li&gt;\";\/g'  |\\\r\n  sed -e 's\/URL\"\/URL\/g' |\\\r\n  sed 's|^  \"url\": |echo \"&lt;li&gt;&lt;a target=\\\\\\\"_blank\\\\\\\" href\\=\\\\\\\"\" \\| tr -d \"\\\\r\\\\n\"; curl -s -D - -o \/dev\/null |g' |\\\r\n  sed 's+,$+ | sed -n ZzZzZzZzZzZzs\\\/^Location: \\\/\\\/pZzZzZzZzZzZz | tr -d '\\'\\\\\\\\r\\\\\\\\n\\'';+g' |  \\\r\n  sed \"s\/ZzZzZzZzZzZz\/'\/g\" |\\\r\n  sed 's\/\"https\/https\/g' | \\\r\n  sed 's|\\\\\/|\/|g' &gt; curls;\r\n  . curls | sed '\/^\"&gt;\/d' &gt; weblinks;\r\n  (echo \"&lt;ul&gt;\"; cat weblinks; echo \"&lt;\/ul&gt;\")\r\n\r\n<\/pre>\n<p>This generates a page containing an HTML list which can be pasted into a WYSIWYG editor on a web page. Here&#8217;s an example<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6314 aligncenter\" src=\"http:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/WebLinks.png\" alt=\"\" width=\"640\" height=\"664\" srcset=\"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/WebLinks.png 640w, https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/files\/2019\/09\/WebLinks-289x300.png 289w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Windows 10 users can open a Unix (Linux) window via the\u00a0 Windows Subsystem for Linux facility see:\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install-win10\">https:\/\/docs.microsoft.com\/en-us\/windows\/wsl\/install-win10<\/a>\u00a0or use linux.ox.ac.uk which can be accessed using Putty (see: <a href=\"https:\/\/www.putty.org\/\">https:\/\/www.putty.org\/<\/a>).<\/p>\n<p>Alternatively, send a message to weblearn@it.ox.ac.uk making sure to include the address\u00a0 (URL) of the WebLearn site containing the Web Links and we&#8217;ll do it for you.<\/p>\n<p>There is one caveat: only the first 5 levels of nested folders in Resources are exported.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web Links, which are items in Resources which, when clicked, redirect the user to a specific web page. In general, these are external web sites but could also be links to pages or documents stored in WebLearn. Web Links are &hellip; <a href=\"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/2019\/09\/exporting-web-links-from-weblearn-resources\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[],"class_list":["post-6313","post","type-post","status-publish","format-standard","hentry","category-weblearn"],"_links":{"self":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/6313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/comments?post=6313"}],"version-history":[{"count":7,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/6313\/revisions"}],"predecessor-version":[{"id":6325,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/posts\/6313\/revisions\/6325"}],"wp:attachment":[{"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/media?parent=6313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/categories?post=6313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs-new.it.ox.ac.uk\/adamweblearn\/wp-json\/wp\/v2\/tags?post=6313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}