├── .DS_Store
├── case
├── .DS_Store
├── index.php
└── res.php
├── composer.json
├── .vscode
└── settings.json
├── search
├── element
│ └── fonts
│ │ ├── element-icons.ttf
│ │ └── element-icons.woff
├── func
│ └── api.php
├── static
│ └── main.js
└── index.html
├── download.php
├── vue
├── cates.php
└── papers.php
├── docs
└── API.md
├── onestep
├── index.php
└── s.php
├── README.md
├── sme
├── index.php
├── sme_qp.php
└── sme_ms.php
├── maintenance.html
├── maintenance.php
├── about.php
├── old
├── cate_old.php
└── paper_old.php
├── ux.js
├── header.php
├── index.php
├── cate.php
├── paper.php
└── style.css
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttttonyhe/snapaper/HEAD/.DS_Store
--------------------------------------------------------------------------------
/case/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttttonyhe/snapaper/HEAD/case/.DS_Store
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "require": {
3 | "jaeger/querylist": "^4.0"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "git.ignoreLimitWarning": true,
3 | "python.pythonPath": "/usr/local/bin/python3"
4 | }
--------------------------------------------------------------------------------
/search/element/fonts/element-icons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttttonyhe/snapaper/HEAD/search/element/fonts/element-icons.ttf
--------------------------------------------------------------------------------
/search/element/fonts/element-icons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ttttonyhe/snapaper/HEAD/search/element/fonts/element-icons.woff
--------------------------------------------------------------------------------
/download.php:
--------------------------------------------------------------------------------
1 | rules([
12 | 'title' => ['li>a','text'],
13 | 'url' => ['li>a','href']
14 | ])->query()->getData();
15 | $user_data = $data->all(); //获取查询数据
16 |
17 | array_splice($user_data, 0, 32);
18 | array_splice($user_data, -77);
19 | $user_data['count'] = count($user_data);
20 | echo json_encode($user_data);
21 |
22 | }
23 | ?>
--------------------------------------------------------------------------------
/vue/cates.php:
--------------------------------------------------------------------------------
1 | rules([
30 | 'name' => ['tr>td>a','text']
31 | ])->query()->getData();
32 | $user_data = $data->all(); //获取查询数据
33 |
34 | $user_data['count'] = count($user_data);
35 | header('Access-Control-Allow-Origin: *');
36 | echo json_encode($user_data);
37 |
38 | }
39 | ?>
--------------------------------------------------------------------------------
/search/static/main.js:
--------------------------------------------------------------------------------
1 | $('#view').css('opacity', '1');
2 |
3 | var search = new FlexSearch({
4 | encode: "extra",
5 | tokenize: "reverse"
6 | });
7 |
8 | var index = new Vue({
9 | el: '#view',
10 | data() {
11 | return {
12 | loading: true,
13 | posts: null,
14 | searched: [],
15 | key: null,
16 | count: 0
17 | }
18 | },
19 | mounted() {
20 | axios.get('func/api.php?key=search')
21 | .then(e => {
22 | this.posts = e.data;
23 | this.count = e.data.count;
24 | this.loading = false;
25 | for (var i = 0; i < this.count; i++) {
26 | search.add(i, this.posts[i].title);
27 | }
28 | })
29 | },
30 | methods: {
31 | s: function () {
32 | this.searched = search.search(this.key);
33 | }
34 | }
35 | });
--------------------------------------------------------------------------------
/docs/API.md:
--------------------------------------------------------------------------------
1 | # Snapaper PAI
2 | Past Paper Resources From GCE Guide | Made with  by TonyHe
3 |
4 |
5 |
6 | ### Usage
7 |
8 | #### Cookies
9 | + Key : snapaper_server
10 | + Value : 1 for gceguide.com
11 | + Value : 0 for gecguide.xyz
12 |
13 |
14 |
15 | #### Cates
16 | Request
17 | ``` php
18 | COOKIES 'snapaper_server' => '1/0'
19 | GET https://www.snapaper.com/vue/cates?cate=:cate
20 | ```
21 | Response
22 | ``` json
23 | {
24 | "0": {
25 | "name": "Accounting (9706)"
26 | },
27 | "1": {
28 | "name": "Afrikaans - Language (AS Level only) (8679)"
29 | }
30 | }
31 | ```
32 |
33 |
34 |
35 | #### Papers
36 | Request
37 | ``` php
38 | COOKIES 'snapaper_server' => '1/0'
39 | GET https://www.snapaper.com/vue/papers?cate=:cate&sub=:subject
40 | ```
41 | Response
42 | ``` json
43 | {
44 | "0": {
45 | "name": "9609_m16_gt.pdf",
46 | "url": "/A Levels/Business (for first examination in 2016) (9609)/9609_m16_gt.pdf"
47 | },
48 | "1": {
49 | "name": "9609_m16_ms_12.pdf",
50 | "url": "/A Levels/Business (for first examination in 2016) (9609)/9609_m16_ms_12.pdf"
51 | }
52 | }
53 | ```
54 |
55 |
56 |
57 | ### Notice
58 | + We've set Access-Control-Allow-Origin: *
59 | + Free of charge
60 | + No guarantee for stability
61 | + The server is located in Beijing, China
62 |
--------------------------------------------------------------------------------
/vue/papers.php:
--------------------------------------------------------------------------------
1 | rules([
38 | 'name' => ['tr>td>a','text'],
39 | 'url' => ['tr>td>a','href']
40 | ])->query()->getData();
41 | $user_data = $data->all(); //获取查询数据
42 | ?>
43 |
44 |
45 |
--------------------------------------------------------------------------------
/onestep/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Choose a category and quickly find a paper
7 |