Skip to content

Instantly share code, notes, and snippets.

/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
@nhindman
nhindman / URX.h
Last active August 29, 2015 14:15
//
// URX.h
//
// Created by Nate.
//
//
#import <Cordova/CDVPlugin.h>
@interface URX : CDVPlugin
@nhindman
nhindman / URX.m
Last active August 29, 2015 14:15
//
// URX.m
//
// Created by Nate Hindman.
//
//
#import "URX.h"
#import <URXWidgets/URXWidgets.h>
[[[URXTerm alloc] initWithKeywords:@"ellie goulding"] searchAsynchronouslyWithSuccessHandler:^(URXSearchResponse *searchResponse) {
// Handle Search Results
} AndFailureHandler:^(URXAPIError *searchError) {
// Handle Error
}];
@nhindman
nhindman / URX-resolution-styling-example.html
Created January 16, 2015 00:50
URX Search Query With Styling & Deep-Link Resolution
<!--In the code block below, we’ve done the following:
1. Added a search box and search button to the page
2. Constructed a URX search query
3. Displayed the search results with styling
4. Attached deep links to the search results that send a user into a destination app (or to the requested content on the web if a user doesn’t have the app installed)-->
<div>
<h1>Use me on your mobile device to find music in your apps:</h1>
<input type="text" id="search-input" placeholder="Artist, album or song" />
<input id="search-button" type="button" value="Search" />
@nhindman
nhindman / URX-style-resolution-example
Last active August 29, 2015 14:13
Adding Style & Resolution To A URX Search Query
<!--In the code block below, we’ve done the following:
1. Added a search box and search button to the page
2. Constructed a URX search query
3. Displayed the search results with styling
4. Attached deep links to the search results that send a user into a destination app (or to the requested content on the web if a user doesn’t have the app installed)-->
<div>
<h1>Use me on your mobile device to find music in your apps:</h1>
<input type="text" id="search-input" placeholder="Artist, album or song" />
<input id="search-button" type="button" value="Search" />
<script type="application/javascript" src="/wp-content/uploads/2015/01/urx-bugfix-this2.js"></script>
<script type="application/javascript">
function goToURX(result){
result.resolveDeeplinkWithWebFallback(function (){});
}
$urx.setApiKey("Uy3q1L8GSPRO+apW20GaufFZNbJ4RQpD5OX9JNxIM3h6AwoKRAg3gU1tGww=|M+wZfGMnswkf+/Zah+9WBhymHb+z0kIJ");
function urxSearch(searchTerm) {
$urx.search(searchTerm, function(response) {
// SEARCH SUCCESS HANDLER
var searchResult = response.results[0];
@nhindman
nhindman / gist:ad3e39b05aee925f2dde
Created January 13, 2015 00:50
Wordpress-urx-search
<script type="application/javascript" src="/wp-content/uploads/2015/01/urx.min_.js"></script>
<script type="application/javascript">
function goToURX(){
this.res.resolveDeeplinkWithWebFallback(function (){});
}
$urx.setApiKey("Uy3q1L8GSPRO+apW20GaufFZNbJ4RQpD5OX9JNxIM3h6AwoKRAg3gU1tGww=|M+wZfGMnswkf+/Zah+9WBhymHb+z0kIJ");
function urxSearch(searchTerm) {
$urx.search(searchTerm, function(response) {
// SEARCH SUCCESS HANDLER
var searchResult = response.results[0];
function zeroFill( number, width ){width -= number.toString().length;if ( width > 0 ){return new Array( width + (/\./.test( number ) ? 2 : 1) ).join( '0' ) + number;}return number; }
$(document).ready(function(){
// $('body').click(function(){
// alert("hello!")
// })
var sites = []
$('#splash-container').on('click', 'a.twitter_linkout', function(e){
e.preventDefault();
var targetElement = e.target;
define(function(require, exports, module) {
var Surface = require("famous/core/Surface");
var CanvasSurface = require("famous/surfaces/CanvasSurface");
var RenderNode = require("famous/core/RenderNode");
var View = require('famous/core/View');
var Modifier = require('famous/core/Modifier');
var Transform = require('famous/core/Transform');
var StateModifier = require('famous/modifiers/StateModifier');
var Easing = require('famous/transitions/Easing');
var Lightbox = require('famous/views/Lightbox');