Skip to content

Instantly share code, notes, and snippets.

🥑
Hangry

Craig Spence phenomnomnominal

🥑
Hangry
Block or report user

Report or block phenomnomnominal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View video.component.html
<youtube-player
videoId="dQw4w9WgXcQ"
suggestedQuality="highres"
[height]="600"
[width]="1080"
[startSeconds]="43"
[endSeconds]="60">
</youtube-player>
View video.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
template: '<youtube-player videoId="dQw4w9WgXcQ"></youtube-player>',
selector: 'app-video'
})
export class VideoComponent implements OnInit {
ngOnInit() {
const tag = document.createElement('script');
tag.src = 'https://www.youtube.com/iframe_api';
View video.module.ts
import { NgModule } from '@angular/core';
import { YouTubePlayerModule } from '@angular/youtube-player';
import { VideoComponent } from './video.component';
@NgModule({
imports: [YouTubePlayerModule],
declarations: [VideoComponent],
exports: [VideoComponent]
})
View is-this-possible-in-ivy.ts
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?!
};
}
View biometrics-appointment-finder.js
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',
View attempt-5.js
const nodemailer = require('nodemailer');
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: process.env.SENDER_EMAIL,
pass: process.env.SENDER_PASSWORD
}
});
View attempt-4.js
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) {
View attempt-3.js
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) => {
View locations.js
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',
View attempt-2.js
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);
});
You can’t perform that action at this time.