Skip to content

Instantly share code, notes, and snippets.

View bob-sims's full-sized avatar

Bob Sims bob-sims

View GitHub Profile
@bob-sims
bob-sims / googleCountryArray.js
Created December 22, 2011 20:37
My take on an array of language codes allowed by Google Search API (hl variable)
var googleCountryArray = ["af","sq","sm","ar","az","eu","be","bn","bh","bs","bg","ca","zh-CN","zh-TW","hr","cs","da","nl","en","en-uk","eo","et","fo","fi","fr","fy","gl","ka","de","el","gu","iw","hi","hu","is","id","ia","ga","it","ja","jw","kn","ko","la","lv","lt","mk","ms","ml","mt","mr","ne","no","nn","oc","fa","pl","pt-BR","pt-PT","pa","ro","ru","gd","sr","si","sk","sl","es","su","sw","sv","tl","ta","te","th","ti","tr","uk","ur","uz","vi","cy","xh","zu"];
@bob-sims
bob-sims / fetchYouTubeJSON.js
Created December 4, 2011 12:32
My take on retrieving YouTube JSON feed by CommonJS module for Ti Mobile, remains work in progress.
// To call, use this statement in app.js:
// require('fetchYouTubeJSON').fetchJSONData('https://gdata.youtube.com/feeds/api/users/...');
// fires app-level event to return data, use to populate TableView or similar
//
// maybe add some cache features? http://pastie.org/1541768
// http://pastebin.com/Eq1DLsdP
// once again, ripping from the talented @skypanther
exports.fetchYouTubeData = function(url) {
// Pulls the JSON feed data and returns it to caller
@bob-sims
bob-sims / 00-README.txt
Created December 3, 2011 23:22
Demo of charts display using simulated web service data. Charts are rendered in WebViews using the RGraph JS library within Titanium Mobile, which works nicely on Android.
This app uses RGraph library to build Android-compatible pie charts using Titanium Mobile.
Brief screencast to demo functionality:
http://youtu.be/itTEwQmvNfY?hd=1
This was for a work prototype/mockup, so excuse the esoteric text labels and fake activity indicator.
I borrowed heavily from prior art.
Aaron Saunder's "Titanium Appcelerator Quickie: Google Charts and Appcelerator"
@bob-sims
bob-sims / 00-readme.txt
Created November 28, 2011 22:28
CommonJS module to pull XML response from from (undocumented) Google Weather API, for use with Titanium Mobile
// console dump of sample returned object
I/TiAPI ( 244): (kroll$4: app://app.js) [797,3312] Object
I/TiAPI ( 244): {
I/TiAPI ( 244): weatherData => Object
I/TiAPI ( 244): {
I/TiAPI ( 244): forecastInfo => Object
I/TiAPI ( 244): {
I/TiAPI ( 244): city => 'Bydgoszcz, Kuyavian-Pomeranian Voivodeship',
@bob-sims
bob-sims / Appcelerator MapView annotation properties
Created March 27, 2011 15:36
Determining which Appcelerator Mobile MapView annotation properties work in Android.
var currentWin = Ti.UI.currentWindow;
// below example would require variable declarations for Name, Description, image, Lat, Longitude
// Docs:
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.Annotation-object
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.MapView-object
//
// CREATE MAP VIEW
//
@bob-sims
bob-sims / menu.js
Created February 23, 2011 23:48
a .js include file for use in Appcelerator Titanium cross-platform mobile apps to create option menus. Option menus display at the bottom of the screen in iPhone and when you press the menu button in an Android app. Credit to Justin Toth.
/*
// Credit to Justin Toth.
// My own edits have been only slight: added property for image (icon) attached to menu item button
To use:
Ti.include('menu.js');
function createMenu() {