Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Desarrollando aplicaciones con Ubuntu One
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Roberto Alsina
June 04, 2012
Programming
1
2.1k
Desarrollando aplicaciones con Ubuntu One
Charla dada en UbuconLA el 3/6/2012
Roberto Alsina
June 04, 2012
Tweet
Share
More Decks by Roberto Alsina
See All by Roberto Alsina
Python en el browser
ralsina
0
90
Python 2 debe morir
ralsina
0
510
Programando Cross-Platform
ralsina
1
2.3k
Haciendo trampa: Trucos para programar menos
ralsina
1
2.2k
Hacer una cosa, pero hacerla bien
ralsina
1
1.3k
libreto.pdf
ralsina
0
100
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
310
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
220
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
130
CSC307 Lecture 01
javiergs
PRO
0
680
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
180
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
180
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.3k
CSC307 Lecture 04
javiergs
PRO
0
650
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
310
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
190
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Paper Plane
katiecoart
PRO
0
46k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
48
A Soul's Torment
seathinner
5
2.2k
Designing Powerful Visuals for Engaging Learning
tmiket
0
210
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
280
Deep Space Network (abreviated)
tonyrice
0
37
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
50
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Transcript
Desarrollando Aplicaciones con Ubuntu One Les Habla: Roberto Alsina Cualquier
cosa, interrumpan, no hay problema. 1
Qué es Ubuntu One • Servicio de storage online •
File sync • Music Store / Music Streaming • U1DB 2
Sync Client 3
APIs • Accounts • Files API • Music Streaming •
U1DB 4
Accounts • Ubuntu Desktop • Websites • Windows • Hagalo
usted mismo 5
Autorización en Ubuntu Usando ubuntuone.platform.credentials: @defer.inlineCallbacks def get_credentials(): tool =
CredentialsManagementTool() creds = yield tool.register() oauth_consumer = oauth2.Consumer( creds['consumer_key'], creds['consumer_secret']) oauth_token = oauth2.Token( creds['token'], creds['token_secret']) 6
Autorización en Django OAuth 1.0a. Usando django_oauth_client: @oauth_token_required('ubuntuone') def create_volume(request):
client = get_client(request.user, 'ubuntuone') response, content = client.request( 'https://one.ubuntu.com/api/file_storage/v1/volumes/~/Shoreham', 'PUT') return redirect('/accounts/profile/') 7
Hágalo Usted Mismo Bueno, es OAuth, fijáte. 8
Files • Volúmenes • Listar/Bajar/Subir/Borrar archivos • Publicar archivos •
Interacción con Sync 9
En Websites @oauth_token_required('ubuntuone') def create_volume(request): client = get_client(request.user, 'ubuntuone') response,
content = client.request( 'https://one.ubuntu.com/api/file_storage/v1/volumes/~/Shoreham', 'PUT') return redirect('/accounts/profile/') 10
En Ubuntu Es Via DBus: /folders method com.ubuntuone.SyncDaemon.Folders.create(path:s) 11
U1DB • Datos estructurados • Sincronizada • Distribuída • Online
y Offline 12
Plataformas • Ubuntu/Windows/OS X - Python - SQLite • Ubuntu
- Vala - SQLite • Ubuntu/Windows/OS X - C - SQLite • Web - javascript - localStorage • Android - Java - SQLite • iOS - Objective-C - SQLite 13
Documentos • create_doc • put_doc • revisiones • delete_doc •
get_doc / get_docs 14
Índices Es un poco más denso, vean el manual? OK!
15
Crear Índices {"firstname": "John", "surname", "Barnes", "position": "left wing"} ID
jb {"firstname": "Jan", "surname", "Molby", "position": "midfield"} ID jm {"firstname": "Alan", "surname", "Hansen", "position": "defence"} ID ah {"firstname": "John", "surname", "Wayne", "position": "filmstar"} ID jw create_index("by-firstname", ["firstname"]) 16
Usar el Índice get_from_index( "by-firstname", [("John", )]) Devuelve una lista
de IDs. 17
Más Ejemplos get_from_index("by_firstname", [("J*")]) get_from_index("by_firstname", [("Jan"), ("Alan")]) 18
Ejemplo import json, u1db db = u1db.open(":memory:", create=True) doc1 =
db.create_doc(json.dumps({"key": "value"}), doc_id="testdoc1") doc2 = db.create_doc(json.dumps({"key": "value"}), doc_id="testdoc2") for doc in db.get_docs(["testdoc2","testdoc1"]): print doc.doc_id Resultado: testdoc1 testdoc2 19
Syncing • API REST • Cliente / Servidor • Conflictos
20
Conflictos • Obtenés un ConflictedDoc • Pensás • Llamás a
resolve_doc 21
Imaginación 22
Preguntas y (Ojalá) Respuestas email:
[email protected]
twitter: @ralsina 23