Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clpallette broken #14

Closed
wijjy opened this issue May 3, 2021 · 9 comments
Closed

clpallette broken #14

wijjy opened this issue May 3, 2021 · 9 comments

Comments

@wijjy
Copy link

wijjy commented May 3, 2021

Something is wrong. I don't know if it is the API or your code. Code for clpallete and clpalettes returns error codes.

Thank you.

palette1 <- clpalette('113451')
Opening and ending tag mismatch: input line 114 and form
Opening and ending tag mismatch: input line 114 and div
Opening and ending tag mismatch: input line 114 and div
Opening and ending tag mismatch: form line 114 and div
Entity 'bull' not defined
Entity 'bull' not defined
Opening and ending tag mismatch: div line 114 and body
Opening and ending tag mismatch: div line 114 and html
EndTag: '</' not found
Error: 1: Opening and ending tag mismatch: input line 114 and form
2: Opening and ending tag mismatch: input line 114 and div
3: Opening and ending tag mismatch: input line 114 and div
4: Opening and ending tag mismatch: form line 114 and div
5: Entity 'bull' not defined
6: Entity 'bull' not defined
7: Opening and ending tag mismatch: div line 114 and body
8: Opening and ending tag mismatch: div line 114 and html
9: EndTag: '</' not found
@donny-son
Copy link

I think there was a change in the API.

@MartinMSPedersen
Copy link
Contributor

The code fails on this line:

        p <- xmlParse(response, options = XML::NOCDATA)

in R/clQuery.R

@fabianwabbel
Copy link

This is a quick fix in file clQuery.r

Reason: Seems Cloudflare does not allow Curl to access the api.

response <- GET(url, user_agent("Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"))

@andrewheiss, maybe you can add this one?

@MartinMSPedersen
Copy link
Contributor

This is a quick fix in file clQuery.r

Reason: Seems Cloudflare does not allow Curl to access the api.

response <- GET(url, user_agent("Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"))

@andrewheiss, maybe you can add this one?

Sorry but no. It is not a user_agent problem. It is colourlovers that returns misformed xml.

@MartinMSPedersen
Copy link
Contributor

It is colourlovers api that ask for a captcha
https://www.colourlovers.com/forums/2,5,343389/api_broken._asking_for_captcha...

@MartinMSPedersen
Copy link
Contributor

I have solved this problem and created a PR!
Huray!
#17

@MartinMSPedersen
Copy link
Contributor

Now it works. Until the PR is accepted, you can use my version:

devtools::install_github("martinmspedersen/colourlovers")
library(colourlovers)
clpalette('1')

Palette ID: 1
Title: metro
Created by user: COLOURlover
Date created: 2004-12-27 14:53:30
Views: 114754
Votes: 1432
Comments: 47
Hearts: 5
Rank: 55
URL: http://www.colourlovers.com/palette/1/metro
Image URL:
Colors: #515151, #FFFFFF, #00B4FF, #EEEEEE

@andrewheiss
Copy link
Owner

Thanks for figuring this out!

@MartinMSPedersen
Copy link
Contributor

New problem and a fix:
49f405c

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

No branches or pull requests

5 participants