Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
0b8624b5
Commit
0b8624b5
authored
Apr 17, 2019
by
Ozzieisaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deleted load metadata from douban, as API seems to be shut down (#858)
parent
91ebe338
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
get_meta.js
cps/static/js/get_meta.js
+9
-13
book_edit.html
cps/templates/book_edit.html
+2
-2
No files found.
cps/static/js/get_meta.js
View file @
0b8624b5
...
...
@@ -25,15 +25,12 @@ var ggResults = [];
$
(
function
()
{
var
msg
=
i18nMsg
;
var
douban
=
"https://api.douban.com"
;
var
dbSearch
=
"/v2/book/search"
;
// var dbGetInfo = "/v2/book/";
// var db_get_info_by_isbn = "/v2/book/isbn/ ";
var
dbDone
=
false
;
/*var douban = "https://api.douban.com";
var dbSearch = "/v2/book/search";*/
var
dbDone
=
true
;
var
google
=
"https://www.googleapis.com/"
;
var
ggSearch
=
"/books/v1/volumes"
;
// var gg_get_info = "/books/v1/volumes/";
var
ggDone
=
false
;
var
showFlag
=
0
;
...
...
@@ -96,7 +93,7 @@ $(function () {
});
ggDone
=
false
;
}
if
(
dbDone
&&
dbResults
.
length
>
0
)
{
/*
if (dbDone && dbResults.length > 0) {
dbResults.forEach(function(result) {
var book = {
id: result.id,
...
...
@@ -130,7 +127,7 @@ $(function () {
$("#book-list").append($book);
});
dbDone = false;
}
}
*/
}
function
ggSearchBook
(
title
)
{
...
...
@@ -150,7 +147,7 @@ $(function () {
});
}
function
dbSearchBook
(
title
)
{
/*
function dbSearchBook (title) {
$.ajax({
url: douban + dbSearch + "?q=" + title + "&fields=all&count=10",
type: "GET",
...
...
@@ -160,7 +157,7 @@ $(function () {
dbResults = data.books;
},
error: function error() {
$
(
"#meta-info"
).
html
(
"<p class=
\"
text-danger
\"
>"
+
msg
.
search_error
+
"!</p>"
);
$("#meta-info").html("<p class=\"text-danger\">" + msg.search_error + "!</p>"
+ $("#meta-info")[0].innerHTML)
},
complete: function complete() {
dbDone = true;
...
...
@@ -168,14 +165,13 @@ $(function () {
$("#show-douban").trigger("change");
}
});
}
}
*/
function
doSearch
(
keyword
)
{
showFlag
=
0
;
$
(
"#meta-info"
).
text
(
msg
.
loading
);
// var keyword = $("#keyword").val();
if
(
keyword
)
{
dbSearchBook
(
keyword
);
//
dbSearchBook(keyword);
ggSearchBook
(
keyword
);
}
}
...
...
cps/templates/book_edit.html
View file @
0b8624b5
...
...
@@ -223,8 +223,8 @@
</div>
<div
class=
"modal-body"
>
<div
class=
"text-center padded-bottom"
>
<input
type=
"checkbox"
id=
"show-douban"
class=
"pill"
data-control=
"douban"
checked
>
<label
for=
"show-douban"
>
Douban
<span
class=
"glyphicon glyphicon-ok"
></span></label>
<
!--
input type="checkbox" id="show-douban" class="pill" data-control="douban" checked>
<label for="show-douban">Douban <span class="glyphicon glyphicon-ok"></span></label
--
>
<input
type=
"checkbox"
id=
"show-google"
class=
"pill"
data-control=
"google"
checked
>
<label
for=
"show-google"
>
Google
<span
class=
"glyphicon glyphicon-ok"
></span></label>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment