Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

get buy links by scraping the google books website #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Shivam60
Copy link
Contributor

No description provided.

@@ -0,0 +1,31 @@
const axios = require('axios');
const cheerio = require('cheerio');

Copy link
Contributor

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'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Shivam60 put the file in dist

Copy link
Contributor Author

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?

Copy link
Contributor

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 ..

@@ -2,6 +2,8 @@ import Vue from 'vue';
import axios from 'axios'
import dotenv from 'dotenv'

var obj = require('./links.js');
Copy link
Contributor

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 ...

@@ -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;
Copy link
Contributor

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

@Shivam60
Copy link
Contributor Author

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.
Kindly have a look at the modifications and also check if it works as i have checked the indivisual components on my local machine only.

@ahegazy
Copy link
Contributor

ahegazy commented Jun 17, 2018

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 ....

@ahegazy
Copy link
Contributor

ahegazy commented Jun 17, 2018

@Shivam60 so i made couple of updates and fixes but we have a major issue ...
those sites you are scrapping doesn't support that in frontend ... obviously you have been testing in the backend so you didn't face this issue ...
I've tried to fix that using the heuroko app but i failed .. so kindly download the latest commit i made to your branch .. and run the app using 'npm run dev' and test the function of it.. .
I'll write some comments on the edits i made here..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants