Skip to content

Instantly share code, notes, and snippets.

//get timeline
oAuthAdapter.send({
url:'https://api.twitter.com/1/statuses/home_timeline.json',
parameters:[
],
method:'GET',
onSuccess:function(response){
alert('got tweets.see info log.');
response = JSON.parse(response);
for(var i=0;i<response.length;i++){
Ti.include('lib/oauth_adapter.js');
var oAuthAdapter = new OAuthAdapter(
'YOUR CONSUMER SECRET',
'YOUR CONSUMER KEY',
'HMAC-SHA1'
);
// load the access token for the service (if previously saved)
oAuthAdapter.loadAccessToken('twitter');
//OAuth if need.
oAuthAdapter.send({
url:'https://api.twitter.com/1/statuses/update.json',
parameters:[
['status', '@mogya Hay I got working oAuthAdapter! '+Math.random()]
],
method:'POST',
onSuccess:function(responce){
alert('post succeed');
}
});
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
title:'10 min twitter client',
tabBarHidden:true,
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
window:win
});
@mogya
mogya / emacs titanium dictionary
Created February 4, 2011 01:05
emacs titanium dictionary
Titanium
Titanium.addEventListener
Titanium.fireEvent
Titanium.include
Titanium.removeEventListener
Titanium.userAgent
Titanium.version
Titanium.API
Titanium.API.addEventListener
Titanium.API.debug
@mogya
mogya / gist:838562
Created February 22, 2011 12:00
webview.evalJS cause hang-up on android #titanium?
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win
});
@mogya
mogya / gist:1056009
Created June 30, 2011 10:56
A test library for Titanium Mobile
var win = Titanium.UI.currentWindow;
var view = Ti.UI.createView();
view.layout = 'vertical';
function addTest(title,action){
var button = Ti.UI.createButton({
title:title,
width:300,
height:30
});
button.addEventListener('click',function(){
@mogya
mogya / gist:1194823
Created September 5, 2011 12:18
show various buttons without any images.
var tabGroup = Titanium.UI.createTabGroup();
var view = Titanium.UI.createView({
});
view.layout = 'vertical';
var win = Titanium.UI.createWindow({
title:'non-image buttons',
font:{fontFamily:'AppleGothic'},
tabBarHidden:true,
backgroundColor:'#fff'
@mogya
mogya / build.py
Created September 25, 2011 12:32
build.py(1.6.2) modification to suppress CFBundleVersion modification
if not simulator:
version = ti.properties['version']
# we want to make sure in debug mode the version always changes
o.write("[INFO] mogya. skip version modification.") # mogya
# version = "%s.%d" % (version,time.time())
ti.properties['version']=version
pp = os.path.expanduser("~/Library/MobileDevice/Provisioning Profiles/%s.mobileprovision" % appuuid)
provisioning_profile = read_provisioning_profile(pp,o)
@mogya
mogya / gist:1417382
Created December 1, 2011 15:01
俺ブラウザ
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title:'俺ブラウザ',
backgroundColor:'#fff'
});
win1.tabBarHidden = true;
var webView = Titanium.UI.createWebView( {
url: "http://oasis.mogya.com/iphone/"
});