needle.js

How to send email using MailChimp API

。_饼干妹妹 提交于 2019-12-02 05:15:36
问题 I'm creating an app in nodejs to send an email using MailChimp. I've tried to use https://apidocs.mailchimp.com/sts/1.0/sendemail.func.php but changed it to use 3.0 api because 1.0 seems to no longer work (big surprise). I've setup my app with var apiKey = '<<apiKey>>', toEmail = '<<emailAddress>>', toNames = '<<myName>>', message = { 'html': 'Yo, this is the <b>html</b> portion', 'text': 'Yo, this is the *text* portion', 'subject': 'This is the subject', 'from_name': 'Me!', 'from_email': '',

Loop through an api get request with variable URL

妖精的绣舞 提交于 2019-11-27 09:53:57
I am trying to call CompaniesHouse API and fetch companies registered between November and February. The approach I took is to pick a starting index(a company registered in November) and a stop index(a company registered in February) and loop through to get the companies registered between the start and stop index. Like so: var needle = require("needle"); var startIdx = 11059000; var stopIdx = 11211109; for(idx = startIdx; idx < stopIdx; idx++) { needle('get', "https://api.companieshouse.gov.uk/company/"+idx, { username: key,password:"" }) .then(function(data) { }) .catch(function(err) {

Loop through an api get request with variable URL

删除回忆录丶 提交于 2019-11-26 14:56:45
问题 I am trying to call CompaniesHouse API and fetch companies registered between November and February. The approach I took is to pick a starting index(a company registered in November) and a stop index(a company registered in February) and loop through to get the companies registered between the start and stop index. Like so: var needle = require("needle"); var startIdx = 11059000; var stopIdx = 11211109; for(idx = startIdx; idx < stopIdx; idx++) { needle('get', "https://api.companieshouse.gov