Skip to content
This repository has been archived by the owner on Sep 7, 2019. It is now read-only.

Commit

Permalink
Remove ebox for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
millette committed Mar 11, 2017
1 parent bf1c4db commit fc02aa5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
14 changes: 10 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict'

/*
FAI (ISP) in Québec.
Expand All @@ -20,22 +22,23 @@ You should have received a copy of the
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

'use strict'

// npm
require('dotenv-safe').load()
const fetchPony = require('fetch-ponyfill')({})
const xml2js = require('xml2js')
const cookie = require('cookie')
const pify = require('pify')
// const xml2js = require('xml2js')
// const pify = require('pify')

/*
const xml2jsParse = (() => {
const xml2jsParseImp = pify(xml2js.parseString)
return (str) => xml2jsParseImp(str, {
explicitArray: false, normalizeTags: true
})
})()
*/

/*
const ebox = {
API: 'http://www.ebox.ca/wp-content/themes/ebox_v2/validationtool_combo/controler_ajax.php',
postalCode: (str) => fetchPony.fetch(ebox.API, {
Expand All @@ -53,6 +56,7 @@ const ebox = {
.then(xml2jsParse)
.then((x) => x.xml)
}
*/

const teksavvy = {
API: 'https://teksavvy.com/TekSavvy.ProductTabs/AvailabilityCheck/CheckAvailability'
Expand Down Expand Up @@ -107,9 +111,11 @@ module.exports = {
acanac: (str) => acanac.postalCode(str)
.then((x) => x[0])
.then(acanac.deets),
/*
ebox: (str) => ebox.postalCode(str)
.then((x) => x[0])
.then(ebox.deets),
*/
teksavvy: (str) => fetchPony.fetch(teksavvy.API, {
method: 'POST',
redirect: 'manual',
Expand Down
7 changes: 5 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
import test from 'ava'
import fn from './'

/*
test.skip('ebox j0k1s0', async t => {
const result = await fn.ebox('j0k1s0')
console.log('R:', result)
t.is(result.cable_available, 'V-Cable')
t.not(result.areservicessupported, 'Yes')
t.not(result.rateband, 'F')
Expand All @@ -22,6 +24,7 @@ test.skip('ebox h2k4b2', async t => {
t.is(result.areservicessupported, 'Yes')
t.is(result.rateband, 'B')
})
*/

test('teksavvy j0k1s0', async t => {
const result = await fn.teksavvy('j0k1s0')
Expand Down Expand Up @@ -55,10 +58,10 @@ test.skip('acanac j0k1s0', async t => {
t.is(result.PhoneOptions[0].ID, 1028)
})

test.skip('acanac j0k2r0', async t => {
test('acanac j0k2r0', async t => {
const result = await fn.acanac('j0k2r0')
t.falsy(result.AvailabilityLookupError)
t.is(result.InternetOptions.length, 4)
t.is(result.InternetOptions.length, 5)
t.is(result.PhoneOptions[0].ID, 1028)
t.is(result.TVOptions.length, 0)
})
Expand Down

0 comments on commit fc02aa5

Please sign in to comment.