Coder Social home page Coder Social logo

infogram-node's People

Contributors

bachstatter avatar dependabot[bot] avatar monder avatar torbjon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

infogram-node's Issues

How to get the PDF

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);
});

Get tags from API

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)

Extract PDF utility not working

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

Syntax Error

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)

Add chart support to API

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.

Error when deleting project

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.