Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion IVLEDownloader.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TARGET = IVLEDownloader
TEMPLATE = app


DEFINES += APIKEY=\\\"k0z3B5Ng9rhy3MKVAKsGG\\\" \
DEFINES += APIKEY=\\\"XafJI3axiXT5MygrV2eL5\\\" \
MAXRECENT=5

SOURCES += main.cpp\
Expand Down
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 7 Oct 2018

Updated with a new API key.

For macOS: You may update the API key with your own!

Step 1: Obtain your own key from IVLE [here](https://ivle.nus.edu.sg/LAPI/default.aspx).
Step 2: Copy paste the following line to terminal: perl -pi -e 's/oldAPIkey/yourAPIkey/g' /path/to/IVLEDownloader.app/Contents/MacOS/IVLEDownloader
where oldAPIkey might be either k0z3B5Ng9rhy3MKVAKsGG or dy1R6cs39qzjQamrIzX6U depending on which version you downloaded.

Credits to whipermr5

---

# Overview

This is simple Qt daemon to automatically download [National University of Singapore](http://www.nus.edu.sg/)'s
Expand All @@ -7,9 +21,14 @@ You can read more about it [here](http://yjyao.com/2012/08/nus-ivle-downloader.h

---

# How to use?
# Developer Notes

In order to compile the source code, Qt SDK 5.5.1 is the last version you may use as newer versions do not include qtwebkit. Qt SDK may be downloaded [here](https://www.qt.io).

In order to compile the source code, You will need the Qt SDK 5.0+, which can be found [here](http://qt.nokia.com/products/qt-sdk/).
When compiling your own app, its recommended to change the APIKEY in the .pro file to your own!

If you want to fork it into your own app, you may consider changing the APIKEY in the .pro file.
Useful links [here](http://doc.qt.io/qt-5/osx-deployment.html) and [here](https://wiki.qt.io/Build_Standalone_Qt_Application_for_Windows)

Troubleshooting qmake [here](https://stackoverflow.com/questions/22116608/cannot-run-qmake-in-mac-terminal)

---
3 changes: 1 addition & 2 deletions externalpageparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#include <QObject>
#include <QVariant>
#include <QtNetwork>
#include <QtWebkit>
#include <QtWebkit>
#include <QtWebKit>
#include <QWebPage>
#include <QWebFrame>
#include "promise.h"
Expand Down
4 changes: 2 additions & 2 deletions ivlefetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ void IVLEFetcher::start(){
return Promise::all(ps, this->session);
})->then([=](const QVariant& data){
emit statusUpdate(complete);
timer->start(300000);
timer->start(3600000);
qDebug()<<data;
}, [=](const QVariant& error){
if(error.toString() == "invalid token"){
emit statusUpdate(invalidToken);
} else {
qDebug()<<"err"<<error;
emit statusUpdate(networkError);
timer->start(300000);
timer->start(3600000);
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Created By &lt;a href=&quot;http://yjyao.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Yujian&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande';&quot;&gt;Created By &lt;/span&gt;&lt;a href=&quot;http://yjyao.com&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; text-decoration: underline; color:#0000ff;&quot;&gt;Yujian&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Lucida Grande';&quot;&gt;, updated by Keith&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
Expand Down
2 changes: 1 addition & 1 deletion settingsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define SETTINGSDIALOG_H

#include <QDialog>
#include <QtWebkitWidgets>
#include <QtWebKitWidgets>
#include <QtWidgets>
#include <QFileDialog>
#include <QCheckBox>
Expand Down