Skip to content

Instantly share code, notes, and snippets.

@nhindman
nhindman / URX.h
Last active August 29, 2015 14:15
//
// URX.h
//
// Created by Nate.
//
//
#import <Cordova/CDVPlugin.h>
@interface URX : CDVPlugin
/*
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,
// Copyright (c) 2014 URX. All rights reserved.
#import "URXListenButtonSearchViewController.h"
#import <URXSearch/URXTerm.h>
#import <URXSearch/URXSearchResult.h>
#import <URXSearch/NSDictionary+JSONLD.h>
#import <URXSearch/URXActionFilter.h>
#import <URXSearch/URXAnd.h>
#define REUSE_IDENTIFIER @"URXSearchResultGenericTableViewCell"
// Copyright (c) 2014 URX. All rights reserved.
#import "URXListenButtonSearchViewController.h"
#import <URXSearch/URXTerm.h>
#import <URXSearch/URXSearchResult.h>
#import <URXSearch/NSDictionary+JSONLD.h>
#import <URXSearch/URXActionFilter.h>
#import <URXSearch/URXAnd.h>
#define REUSE_IDENTIFIER @"URXSearchResultGenericTableViewCell"
<script>
$urx.setApiKey("API KEY GOES HERE");
var geoFilter = "near:40.748441,-73.985664";
var actionFilter = " action:BuyAction";
var domainFilter = " domain:seatgeek.com domain:stubhub.com domain:ticketmaster.com"
$urx.search(geoFilter + actionFilter + domainFilter, function(response) {
var searchResult = response.results[0];
}, function(req, errorMessage){
// SEARCH FAILURE HANDLER
console.log(errorMessage);
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" itemscope="" itemtype="http://schema.org/NewsArticle" itemid="http://mic.com/articles/74689/the-8-most-dysfunctional-families-in-tv-history"> <!--<![endif]-->
<head><meta name="title" content="Stevie Wonder Isn't Blind — and 10 More of Music's Craziest Conspiracy Theories">
<meta name="description" content="People actually believe these things?">
<meta property="article:published_time" content="2015-03-06T13:52:36.000Z">
<meta property="og:type" content="article">
// Copyright (c) 2014 URX. All rights reserved.
#import "URXListenButtonSearchViewController.h"
#import <URXSearch/URXTerm.h>
#import <URXSearch/URXSearchResult.h>
#import <URXSearch/NSDictionary+JSONLD.h>
#import <URXSearch/URXRawQuery.h>
#define REUSE_IDENTIFIER @"URXSearchResultGenericTableViewCell"
<!DOCTYPE html>
<!-- Mobile redirect: 80 -->
lessc _theme/sphinx_rtd_theme/static/css/theme.less > _theme/sphinx_rtd_theme/static/css/theme.css
lessc urx-styles/base.less > _theme/sphinx_rtd_theme/static/css/bootstrap.css
# TODO: make clean should probably clean these fonts out. but oh well...
cp -r urx-styles/bootstrap/fonts/ _theme/sphinx_rtd_theme/static/fonts/
- (IBAction)buttonTapped:(id)sender {
NSLog(@"%s: %d", __func__, __LINE__);
URXDomainFilter *query = [URXDomainFilter domainWithPLD:@"lyft.com"];
[query searchAsynchronouslyWithSuccessHandler:^(URXSearchResponse *response) {
NSLog(@"response=%@", response);
URXSearchResult *result = [response.results firstObject];
[result resolveAsynchronouslyWithWebFallbackAndFailureHandler:^(URXAPIError *error) {
NSLog(@"error=%@", error);
}];
} andFailureHandler:^(URXAPIError *error) {