infogram / infogram-node Goto Github PK
View Code? Open in Web Editor NEWA Node.js wrapper for Infogram API
Home Page: https://npmjs.com/package/infogram
License: MIT License
A Node.js wrapper for Infogram API
Home Page: https://npmjs.com/package/infogram
License: MIT License
Hey, so I'm able to get a response from the getProject API call:
{ id: '108719dd-d342-46d5-97b0-a20ad1d15d91',
title: 'Copy: Kanye West Report',
theme_id: 178,
published: true,
thumbnail_url: 'https://s3-eu-west-1.amazonaws.com/infogram-thumbs-200/108719dd-d342-46d5-97b0-a20ad1d15d91.jpg',
date_modified: '2016-08-11T02:15:32.000Z',
user_profile: 'gmensah',
publish_mode: 'private',
url: 'https://infogr.am/_/qcTVzh0OQKJHY8ci6Mcc',
embed_responsive: '<script id="infogram_0__/qcTVzh0OQKJHY8ci6Mcc" title="Copy: Kanye West Report" src="//e.infogr.am/js/embed.js?jVE" type="text/javascript"></script>',
embed_async: '<div class="infogram-embed" data-id="_/qcTVzh0OQKJHY8ci6Mcc" data-type="interactive" data-title="Copy: Kanye West Report"></div><script>!function(e,t,n,s){var i="InfogramEmbeds",o=e.getElementsByTagName(t),d=o[0],a=/^http:/.test(e.location)?"http:":"https:";if(/^\\/{2}/.test(s)&&(s=a+s),window[i]&&window[i].initialized)window[i].process&&window[i].process();else if(!e.getElementById(n)){var r=e.createElement(t);r.async=1,r.id=n,r.src=s,d.parentNode.insertBefore(r,d)}}(document,"script","infogram-async","//e.infogr.am/js/dist/embed-loader-min.js");</script>' }
How do I extract the PDF file? Currently the test.pdf create cannot be opened as it not the right format. This is what I have so far:
infogram.getProject('108719dd-d342-46d5-97b0-a20ad1d15d91', { format: 'pdf' }).then(function(data) {
console.log(data);
fs.writeFile('test.pdf', data, function(err) {
if(err) { return console.log(err); }
console.log('The file was saved!');
});
}, function(err) {
console.error(err);
});
the inform-methods.js includes a couple of issues with the params = {},
if you remove the '={}' it works fine.
It would be great to get the Infogram tags from the API as well.
(Context: I'm creating a Wordpress site, with 100+ posts based around Infogram charts. The site structure is heavily based on categories and tags, so it would be great to be able to get these programmatically)
Running the simple example found here: https://github.com/infogram/infogram-node/blob/master/examples/examples.js
Getting a nondescript 500. Is the API still maintained?
I did as mentioned passing project id
and still there is no data logging(showing empty object) into console.log
. So if data is empty object, what would filesystem API of node would write ?
Screenshot - http://prntscr.com/jyy88t
@torbjon Do you know alternative way to how to extract as a pdf ?
Also when I am using this API of getProject
method without extra arguments then data is been logging correctly. So that states that when extra arguments are supplied such as {format : pdf}
then it's showing empty object while data is been logging.
Waiting for response. Thanks
see #3 Still getting the same error:
/Users/garethkmensah/Desktop/infogram-node-master/src/infogram-methods.js:10
getProject: function (id, params = {}) {
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/Users/garethkmensah/Desktop/infogram-node-master/src/server.js:2:21)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
Hello!
Here at the company we opted to use Infogram's API to make the charts for this specific application and purchased the business plan.
But then, the API only supports infographics. Is it possible to add single chart to it? We really need this one feature. And also add options to edit the share button and more, please.
When i try do delete the project using deleteProject(id) it returns an error TypeError: Cannot read property 'format' of undefined. This error only happens when i try do delete.
TypeError: Cannot read property 'format' of undefined at Object.call (node_modules\infogram\src\infogram-api.js:50:41) at Object.delete (node_modules\infogram\src\infogram-api.js:35:17) at Object.deleteProject (node_modules\infogram\src\infogram-methods.js:15:23) at Observable._subscribe (dist\data\services\InfogramService.js:102:26) at Observable._trySubscribe (node_modules\@reactivex\rxjs\dist\cjs\Observable.js:57:25) at Observable.subscribe (node_modules\@reactivex\rxjs\dist\cjs\Observable.js:45:27) at Context.<anonymous> (dist\test\integration\data\service\InfogramService.test.js:72:49)
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.