mrvautin / metaget Goto Github PK
View Code? Open in Web Editor NEWA Node.js module to fetch HTML meta tags (including Open Graph) from a remote URL
License: MIT License
A Node.js module to fetch HTML meta tags (including Open Graph) from a remote URL
License: MIT License
Will you be publishing latest code to npm? I just came on here to put in a PR to fix the error condition but I see it was already fixed. We keep running into this case where the app crashes because response.statusCode
is undefined
.
Thanks
To reproduce... google.co
Hello, I'm having trouble getting the metadata..
The problem happens when I try to get the data from this url:
This is the answer I get:
"title":"Estrela cadente? Nasa diz que asteroide gigante passar� pr�ximo � Terra logo ap�s o Natal","description":"N�o h� perigo de colis�o"
I am trying to solve this problem for hours, and I believe it is related to request or cheerio.
I tried some solutions that I found in stack overflow, one of them was using iconv-lite
I used it like this:
var body1 = iconv.decode(body, 'ISO-8859-1');
var $ = cheerio.load(body1);
I also addedencoding: null
to the options object.
After doing this, I get the data the way I would like:
"title":"Estrela cadente? Nasa diz que asteroide gigante passará próximo à Terra logo após o Natal","description":"Não há perigo de colisão"
However if i try to get the data from this url i have problems again...
This is the answer I get:
"title":"Dez eletrônicos curiosos lançados pela Xiaomi em 2019","description":"Empresa chinesa se destacou pela variedade de dispositivos anunciados em 2019"
If I undo all the changes I made I get the expected answer:
"title":"Dez eletrônicos curiosos lançados pela Xiaomi em 2019","description":"Empresa chinesa se destacou pela variedade de dispositivos anunciados em 2019"
Could you help me fix this? I have no idea how to solve this problem, my knowledge of javascript is very limited, I'm a mobile developer and sometimes I need to do something with javascript in my backend.
I have been using this module for several months and only now have I noticed the problem.
if the website not responding get the following error "cannot read statusCode of undefined"
This error come from :
callback(new Error('Bad Request' + response.statusCode)); (line 55 in index.js)
since the response is undefined can't acces to statusCode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.