This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, Directive, Pipe } from '@angular/core'; | |
| import { DatePipe as date, NgIf as ngIf } from '@angular/common'; | |
| import { SomethingComponent as something } from './something.component'; | |
| const template = function (templates: TemplateStringsArray, ...declarations: Array<Component | Directive | Pipe>) { | |
| return function () { | |
| // ivyMagicHere?! | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require('request').defaults({ jar: true}); | |
| const nodemailer = require('nodemailer'); | |
| const LOCATIONS = { | |
| STOCKHOLM: 'Z209', | |
| GÖTEBORG: 'Z102', | |
| MALMÖ: 'KCMA', | |
| TILLSTÅNDSPRÖVNING: 'BBBO', | |
| BORLÄNGE: 'NHL', | |
| JÖNKÖPING: 'Z085', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const nodemailer = require('nodemailer'); | |
| const transporter = nodemailer.createTransport({ | |
| service: 'gmail', | |
| auth: { | |
| user: process.env.SENDER_EMAIL, | |
| pass: process.env.SENDER_PASSWORD | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const LOCATIONS = { /* ... */ }; | |
| const LOCATION_NAMES = Object.keys(LOCATIONS); | |
| const ALL_APPOINTMENTS = {}; | |
| console.log('🇸🇪💉 Info: Starting loop!'); | |
| let index = 0; | |
| setInterval(() => { | |
| getAppointmentsForLocation(LOCATION_NAMES[index]); | |
| if (index === LOCATION_NAMES.length - 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require('request').defaults({ jar: true}); | |
| const LOCATIONS = { /* ... */ }; | |
| const PAGE_REGEXP = /(\d+-\d+)\.IBehaviorListener/; | |
| const URL_ROOT = 'https://www.migrationsverket.se/ansokanbokning/'; | |
| function getAppointmentsForLocation (location) { | |
| const bookingPageUrl = `valjtyp?sprak=en&bokningstyp=2&enhet=${LOCATIONS[location]}&sokande=1`; | |
| request(`${URL_ROOT}${bookingPageUrl}`, (_, _, body) => { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const LOCATIONS = { | |
| STOCKHOLM: 'Z209', | |
| GÖTEBORG: 'Z102', | |
| MALMÖ: 'KCMA', | |
| TILLSTÅNDSPRÖVNING: 'BBBO', | |
| BORLÄNGE: 'NHL', | |
| JÖNKÖPING: 'Z085', | |
| NORRKÖPING: 'Z083', | |
| SUNDSVALL: 'BBSU', | |
| UMEÅ: 'BBUM', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require('request'); | |
| const URL = 'https://www.migrationsverket.se/ansokanbokning/valjtyp?sprak=sv&bokningstyp=2&enhet=Z209&sokande=2'; | |
| request(URL, function (err, _, body) { | |
| console.log(body); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $svjq('#bokaSubmit').click(function(e){ | |
| var paramStr = ""; | |
| var myHistoryArr = inlotsning.history.split(','); | |
| for(var i = 1; i < myHistoryArr.length; i++) { | |
| var arr = myHistoryArr[i].split(':'); | |
| paramStr = paramStr + "&"+ arr[0] +"="+ arr[1] +""; | |
| } | |
| window.location = "/ansokanbokning/valjtyp?sprak=sv"+ paramStr +""; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HOST: https://www.migrationsverket.se | |
| PAGE: /ansokanbokning/wicket/page | |
| QUERY PARAMS: | |
| ?4-1.IBehaviorListener.1-form-kalender-kalender | |
| &start=2019-07-08T00%3A00%3A00%2B00%3A00 | |
| &end=2019-07-15T00%3A00%3A00%2B00%3A00 | |
| &_=1561072933552 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require('request'); | |
| const HOST = 'https://www.migrationsverket.se/ansokanbokning/wicket/'; | |
| const API = 'page?6-1.IBehaviorListener.1-form-kalender-kalender&start=2019-08-19&end=2019-08-26&_=1561069474473'; | |
| request(`${HOST}${API}`, function (err, _, body) { | |
| console.log(body); | |
| }); |