From d04e115823d5ae9e0467288d1a5d64de9f95738f Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Tue, 4 Jun 2013 14:44:15 +0300 Subject: [PATCH] Remove media/academicearth.lua academicearth.org now links to YouTube video pages. The "elective" videos are (AFAICT) HTML5 videos and there are only a handful of those at the time of writing this. Signed-off-by: Toni Gundogdu --- share/Makefile.am | 1 - share/media/academicearth.lua | 64 --------------------------------------- tests/media/academicearth.mk | 6 ---- tests/media/media_academicearth.c | 62 ------------------------------------- tests/media/tests.mk | 1 - 5 files changed, 134 deletions(-) delete mode 100644 share/media/academicearth.lua delete mode 100644 tests/media/academicearth.mk delete mode 100644 tests/media/media_academicearth.c diff --git a/share/Makefile.am b/share/Makefile.am index 627e143..02facba 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -31,7 +31,6 @@ mediadir=$(pkgdatadir)/$(VERSION)/media dist_media_DATA=\ media/101greatgoals.lua\ - media/academicearth.lua\ media/ardmediathek.lua\ media/audioboo.lua\ media/bikeradar.lua\ diff --git a/share/media/academicearth.lua b/share/media/academicearth.lua deleted file mode 100644 index ba3a459..0000000 --- a/share/media/academicearth.lua +++ /dev/null @@ -1,64 +0,0 @@ --- libquvi-scripts --- Copyright (C) 2010-2013 Toni Gundogdu --- --- This file is part of libquvi-scripts . --- --- This program is free software: you can redistribute it and/or --- modify it under the terms of the GNU Affero General Public --- License as published by the Free Software Foundation, either --- version 3 of the License, or (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU Affero General Public License for more details. --- --- You should have received a copy of the GNU Affero General --- Public License along with this program. If not, see --- . --- - --- --- NOTE: aearth hosts the media at youtube, return 'goto_url' --- - -local AcademicEarth = {} -- Utility functions specific to this script - --- Identify the media script. -function ident(qargs) - return { - can_parse_url = AcademicEarth.can_parse_url(qargs), - domains = table.concat({'academicearth.org'}, ',') - } -end - --- Parse media properties. -function parse(qargs) - return AcademicEarth.to_media_url(qargs) -end - --- --- Utility functions --- - -function AcademicEarth.can_parse_url(qargs) - local U = require 'socket.url' - local t = U.parse(qargs.input_url) - if t and t.scheme and t.scheme:lower():match('^http$') - and t.host and t.host:lower():match('academicearth%.org$') - and t.path and t.path:lower():match('^/lectures/') - then - return true - else - return false - end -end - -function AcademicEarth.to_media_url(qargs) - local p = quvi.http.fetch(qargs.input_url).data - qargs.goto_url = p:match('"(http://www%.youtube%.com/watch.-)"') - or error('no match: unrecognized media source') - return qargs -end - --- vim: set ts=2 sw=2 tw=72 expandtab: diff --git a/tests/media/academicearth.mk b/tests/media/academicearth.mk deleted file mode 100644 index df1773d..0000000 --- a/tests/media/academicearth.mk +++ /dev/null @@ -1,6 +0,0 @@ -TEST_PROGS+=media_academicearth -media_academicearth_SOURCES=media/media_academicearth.c -media_academicearth_CPPFLAGS=$(testsuite_cppflags) -media_academicearth_LDFLAGS=$(testsuite_ldflags) -media_academicearth_LDADD=$(testsuite_ldadd) -media_academicearth_CFLAGS=$(AM_CFLAGS) diff --git a/tests/media/media_academicearth.c b/tests/media/media_academicearth.c deleted file mode 100644 index 725243a..0000000 --- a/tests/media/media_academicearth.c +++ /dev/null @@ -1,62 +0,0 @@ -/* libquvi-scripts - * Copyright (C) 2012 Toni Gundogdu - * - * This file is part of libquvi-scripts . - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU Affero General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General - * Public License along with this program. If not, see - * . - */ - -/* media/academicearth.lua uses the "goto_url", this means that the media - * is hosted elsewhere, in this case: YouTube. */ - -#include "config.h" - -#include -#include -#include - -#include "tests.h" - -static const gchar URL[] = - "http://www.academicearth.org/lectures/darwin-and-science"; - -static const gchar TITLE[] = - "History 2D: Science, Magic, and Religion, Lecture 12, UCLA"; - -static const gchar ID[] = - "QIDXKoy59Ho"; - -static void test_media_academicearth() -{ - struct qm_test_exact_s e; - struct qm_test_opts_s o; - - memset(&e, 0, sizeof(e)); - memset(&o, 0, sizeof(o)); - - e.title = TITLE; - e.id = ID; - - qm_test(__func__, URL, &e, &o); -} - -gint main(gint argc, gchar **argv) -{ - g_test_init(&argc, &argv, NULL); - g_test_add_func("/media/academicearth", test_media_academicearth); - return (g_test_run()); -} - -/* vim: set ts=2 sw=2 tw=72 expandtab: */ diff --git a/tests/media/tests.mk b/tests/media/tests.mk index f849e30..a742d47 100644 --- a/tests/media/tests.mk +++ b/tests/media/tests.mk @@ -1,5 +1,4 @@ include $(top_srcdir)/tests/media/101greatgoals.mk -include $(top_srcdir)/tests/media/academicearth.mk include $(top_srcdir)/tests/media/ardmediathek.mk include $(top_srcdir)/tests/media/arte.mk include $(top_srcdir)/tests/media/audioboo.mk -- 2.11.4.GIT