summaryrefslogtreecommitdiff
path: root/dist/epgdata2xmltv/epgdata2xmltv.h
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2011-07-24 16:50:37 +0200
committerJochen Dolze <vdr@dolze.de>2011-07-24 16:50:37 +0200
commit653b36f3db380683e73cb0ae3c17ddc28bd41fa1 (patch)
tree15cfb0b6299213d92bbfc2869607b1263146a3e4 /dist/epgdata2xmltv/epgdata2xmltv.h
parent107836c3b0f013e73c6cf572d8947c8d9133d39d (diff)
downloadvdr-plugin-xmltv2vdr-653b36f3db380683e73cb0ae3c17ddc28bd41fa1.tar.gz
vdr-plugin-xmltv2vdr-653b36f3db380683e73cb0ae3c17ddc28bd41fa1.tar.bz2
Added epgdata importer
Diffstat (limited to 'dist/epgdata2xmltv/epgdata2xmltv.h')
-rw-r--r--dist/epgdata2xmltv/epgdata2xmltv.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/dist/epgdata2xmltv/epgdata2xmltv.h b/dist/epgdata2xmltv/epgdata2xmltv.h
new file mode 100644
index 0000000..3748c5d
--- /dev/null
+++ b/dist/epgdata2xmltv/epgdata2xmltv.h
@@ -0,0 +1,52 @@
+/*
+ * epgdata2xmltv.h: a grabber for the xmltv2vdr plugin
+ *
+ */
+
+#ifndef __EPGDATA2XMLTV_H
+#define __EPGDATA2XMLTV_H
+
+#include <curl/curl.h>
+#include <curl/types.h>
+#include <curl/easy.h>
+
+#include <libxslt/transform.h>
+#include <libxslt/xsltutils.h>
+#include <libexslt/exslt.h>
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#define esyslog(a...) void( (SysLogLevel > 0) ? syslog_with_tid(a) : void() )
+#define isyslog(a...) void( (SysLogLevel > 1) ? syslog_with_tid(a) : void() )
+#define dsyslog(a...) void( (SysLogLevel > 2) ? syslog_with_tid(a) : void() )
+#define tsyslog(a...) void( (SysLogLevel > 3) ? syslog_with_tid(a) : void() )
+
+#define EPGDATA2XMLTV_USERAGENT "libcurl-agent/1.0"
+#define EPGDATA2XMLTV_URL "http://www.epgdata.com/index.php?action=sendPackage&iOEM=VDR&dataType=xml&dayOffset=%s"
+
+struct data
+{
+ size_t size;
+ int fd;
+};
+
+class cepgdata2xmltv
+{
+private:
+ struct data data;
+ xsltStylesheetPtr pxsltStylesheet;
+ xmlDocPtr sxmlDoc;
+ char *strreplace(char *s, const char *s1, const char *s2);
+ int Fetch(const char *path, const char *pin, int day);
+ int DownloadData(const char *url);
+ bool Translate(xmlDocPtr pxmlDoc, const char **params);
+ void LoadXSLT();
+public:
+ cepgdata2xmltv();
+ ~cepgdata2xmltv();
+ int Process(int argc, char *argv[]);
+};
+
+#endif //__EPGDATA2XMLTV_H