...
 
Commits (5)
......@@ -8,7 +8,11 @@
#mesondefine CACHE_ROOT
// how verbose the http requests are: 0–none, 1–headers only, 2–headers and beginning of text 3+–dump all
// how verbose the http requests are:
// 0 – none
// 1 – headers only
// 2 – headers and beginning of response text
// 3+ – dump all
#define LOGGING_REQUESTS 0
#define APP_NAME "ch.gnugen.Moody"
......
......@@ -18,7 +18,6 @@
#include <myhtml/myhtml.h>
#include <assert.h>
#include <stdlib.h>
#include "moodle-parser.h"
#include "data-struct.h"
#include "config.h"
......@@ -129,7 +128,7 @@ moodle_parse_folder_content (const gchar *html, gsize html_size, const gchar *mo
if (href) {
if ((type = read_link (href, &id, &filename) == -1)) {
g_warning ("Some unknown link\n");
g_warning ("Some unknown file\n");
continue;
}
if (node->child && node->child->next && node->child->next->child) {
......@@ -195,7 +194,6 @@ moodle_parse_course_list (const gchar *html, gsize html_size, const gchar *filen
if (strcmp (myhtml_attribute_key (attr, NULL), "href") == 0) {
// we found the href attribute
if (g_str_has_prefix (myhtml_attribute_value (attr, NULL), EPFL_COURSE_LINK))
if (g_strcmp0 (myhtml_attribute_value (attr, NULL), "https://moodle.epfl.ch/course/view.php?id=14247")) // FIXME
string = myhtml_attribute_value (attr, &size); // yay!
break;
}
......@@ -223,8 +221,7 @@ moodle_parse_course_list (const gchar *html, gsize html_size, const gchar *filen
myhtml_collection_destroy (hrefs);
myhtml_tree_destroy (tree);
struct Courses courses_struct = {courses, count};
return courses_struct;
return (struct Courses) {count, courses};
}
......@@ -283,8 +280,7 @@ moodle_extract_week (gchar *week_name, myhtml_tree_t *tree, myhtml_tree_node_t *
}
}
struct Week week = {week_name, resource_count, resources};
return week;
return (struct Week) {week_name, resource_count, resources};
}
......
......@@ -16,11 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <libsoup/soup.h>
#include "moodle-provider.h"
#include "moodle-parser.h"
#include "password.h"
#include "utils.h"
#include "config.h"
......