-
Notifications
You must be signed in to change notification settings - Fork 4
get buy links by scraping the google books website #17
base: master
Are you sure you want to change the base?
Conversation
src/store/links.js
Outdated
@@ -0,0 +1,31 @@ | |||
const axios = require('axios'); | |||
const cheerio = require('cheerio'); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the link.js shouldn't be in store directory .. it should with the rest of assets we are using .. like ' xml2json.min.js' at src or we can create a separate directory called 'libs' for both of them and any other thing we use ..
we should look into that ..
anyway please move this file to 'src'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved it into src/dist. Would that be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes .. Change the variables names, add goodreads support and push it to your branch ..
src/store/actions.js
Outdated
@@ -2,6 +2,8 @@ import Vue from 'vue'; | |||
import axios from 'axios' | |||
import dotenv from 'dotenv' | |||
|
|||
var obj = require('./links.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you name the file and the object a descriptive name ...
src/store/actions.js
Outdated
@@ -158,6 +160,11 @@ export default{ | |||
ResultsObj.average_rating = result.volumeInfo.maturityRating; | |||
ResultsObj.description = (typeof result.volumeInfo.description == 'string')? result.volumeInfo.description : "N/A"; | |||
var authors = []; | |||
|
|||
obj.getlinks(url).then(function(res){ | |||
ResultsObj.links=res; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better if it's called 'ResultsObj.buy_links' for example
I have incorporated the changes. Furthermore I have added the goodreads functionality also. So now i ll scrape the goodreads website for links and i ll get the list of urls. These urls later redirect to the respective shops such as amazon. I then return the re directed urls. |
I'll take a look at it and test it tomorrow.... And I'll push some minor updates+ use the result in book.vue to your branch .... |
@Shivam60 so i made couple of updates and fixes but we have a major issue ... |
No description provided.