Skip to content

Instantly share code, notes, and snippets.

var tinder = require('tinderjs');
var client = new tinder.TinderClient();
var recommendations = [];
var counts = {};
var occuranceBeforeLike = 3;
var loopCount = 10;
/*
Get your facebook token here
https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token
@daviddt
daviddt / example.js
Created November 9, 2015 09:10
example.js
import angular from 'angular';
import ExampleController from './example-controller/example-controller.js';
import ExampleDirective from './example-directive/example-directive.js';
import ExampleService from './example-service/example-service.js';
export default angular.module('example', [])
.controller('exampleController', ExampleController)
.service('exampleService', ExampleService)
.directive('exampleDirective', () => new ExampleDirective);
export default class ExampleDirective {
constructor() {
this.template = '<div>{{ctrl.name}}</div>';
this.restrict = 'E';
this.scope = {};
this.controller = ExampleDirectiveController;
this.controllerAs = 'ctrl';
this.bindToController = true;
}
export default class ExampleService {
constructor($http) {
this.$http = $http;
}
// Example service function
getData () {
return this.$http({method: 'GET', url: './api' });
}
}
export default class ExampleController {
constructor() {
this.controllerName = 'Example Controller';
}
}
/// <reference path="../typings/_custom.d.ts" />
import { bootstrap, bind } from 'angular2/angular2';
import { routerInjectables, LocationStrategy, HashLocationStrategy } from 'angular2/router';
import { Spotify } from './services/spotify';
import { App } from './components/app';
/// <reference path="../../../typings/_custom.d.ts" />
import { Component, View, NgIf } from 'angular2/angular2';
import { RouterLink, RouteParams } from 'angular2/router';
import { Spotify } from '../../services/spotify';
import { status, json } from '../../utils/fetch'
@Component({
selector: 'artist',
viewInjector: [Spotify]
/// <reference path="../../../typings/_custom.d.ts" />
import { Component, View, NgFor, Inject } from 'angular2/angular2';
import { RouterLink, RouteParams } from 'angular2/router';
import { Spotify } from '../../services/spotify';
import { status, json } from '../../utils/fetch'
@Component({
selector: 'search',
viewInjector: [Spotify]
export function status(response) {
if (response.status >= 200 && response.status < 300) {
return Promise.resolve(response);
}
return response.text().then(function(text) {
throw new Error(text);
});
}
export function text(response) {
/// <reference path="../../typings/_custom.d.ts" />
import { Injectable } from 'angular2/angular2';
@Injectable()
export class Spotify {
url: string;
constructor() {
this.url = 'https://api.spotify.com/v1/';
}