hackeando o facebook e o twitter com python ti no vale

50
Hackeando o Twitter e o Facebook com Python @fmasanori TI no Vale http://www.slideshare.net/fmasanori

Upload: fernando-masanori

Post on 13-Jun-2015

4.150 views

Category:

Education


6 download

DESCRIPTION

Hacking básico do Facebook e do Twitter com Python. Baterias incluídas. Prévia da Oficina que darei no Campus Party 2013.

TRANSCRIPT

Page 1: Hackeando o Facebook e o Twitter com Python TI no Vale

Hackeando o Twitter e o Facebook com Python

@fmasanori TI no Vale

http://www.slideshare.net/fmasanori

Page 2: Hackeando o Facebook e o Twitter com Python TI no Vale

Agenda (Python 2.7)

• Python vale a pena

• JSON killer module

• Twitter Client

• Facebook Hacking

• Reddit & MongoDB (se der tempo)

• Propaganda

• Perguntas

Page 3: Hackeando o Facebook e o Twitter com Python TI no Vale
Page 4: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: cases de sucesso

Page 5: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: cases de sucesso

Page 6: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: cases de sucesso

Page 7: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: cases de sucesso

Page 8: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: cases de sucesso

Page 9: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: quem usa

Page 10: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: quem usa

Page 11: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: quem usa

Page 12: Hackeando o Facebook e o Twitter com Python TI no Vale

Python: quem usa em SJC

Page 13: Hackeando o Facebook e o Twitter com Python TI no Vale

Github e StackOverflow

Page 14: Hackeando o Facebook e o Twitter com Python TI no Vale

Job Trends Indeed.com

Page 15: Hackeando o Facebook e o Twitter com Python TI no Vale

Language of the year 2007 and 2010

Page 16: Hackeando o Facebook e o Twitter com Python TI no Vale

Melhora da auto estima do aluno

Page 17: Hackeando o Facebook e o Twitter com Python TI no Vale

Tempo para ser produtivo

C 2 a Java 6 m Python 1 m

Page 18: Hackeando o Facebook e o Twitter com Python TI no Vale

JSON killer module

Page 19: Hackeando o Facebook e o Twitter com Python TI no Vale

JavaScript Object Notation

• http://json.org/

• Independente de linguagem

• Pares nome/valor

• Lista ordenada

• Muito adotado atualmente

• Alternativa para o XML – XML mais verbosa

– XML menor legibilidade

Page 20: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Client

Page 21: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Client

Page 22: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Client

Page 23: Hackeando o Facebook e o Twitter com Python TI no Vale

Sentiment Analysis

menina1: aaaaaaaaaaaaaaaaaaa eu NAO GOSTO DELE

menina2: e vc ficará rica , e irá dividir sua

riqueza cm sua amg aq *u*

menina1: kkkkkk como assim eu fikar rica pq ??

menina2: pq ele é inteligente , e vai arranjar

um ótimo emprego , e ganhar mt dinheiro rs

menina1: kkkkk ele é inteligente como assim ??

menina2: AQUELE VIADO PASSOU NO CASDINHO , E EU

NAO !

Page 24: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Client

https://gist.github.com/4120037

(by Pamela Fox)

Page 25: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Trending Topics

Page 26: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Trending Topics

https://gist.github.com/4121001

(by Bruno Rocha)

Page 27: Hackeando o Facebook e o Twitter com Python TI no Vale

Twitter Trending Topics

Page 28: Hackeando o Facebook e o Twitter com Python TI no Vale

Facebook Hacking

Page 29: Hackeando o Facebook e o Twitter com Python TI no Vale

Hackers não são “do mal”?

Page 30: Hackeando o Facebook e o Twitter com Python TI no Vale

“O Facebook é dirigido por hackers. A maioria das pessoas pensa de um hacker como alguém que invade um sistema de computador. Mas nós vemos isso como uma filosofia. Aqui, os hackers assumem que sempre há uma maneira melhor, mais eficiente de resolver problemas.” facebook.com/careers

Page 31: Hackeando o Facebook e o Twitter com Python TI no Vale

graph.facebook.com

Page 33: Hackeando o Facebook e o Twitter com Python TI no Vale

Facebook profile

Page 34: Hackeando o Facebook e o Twitter com Python TI no Vale

Facebook profile photo

Page 35: Hackeando o Facebook e o Twitter com Python TI no Vale

Facebook Graph API

• https://graph.facebook.com

• Objetos JSON

• Links autenticados

• Obs.: access_token expira

• Autenticar novamente neste caso

Page 36: Hackeando o Facebook e o Twitter com Python TI no Vale

Facebook Friends

Page 37: Hackeando o Facebook e o Twitter com Python TI no Vale

Facebook Friends Photos

https://gist.github.com/4124876

Page 38: Hackeando o Facebook e o Twitter com Python TI no Vale

Android Wallpaper

Page 39: Hackeando o Facebook e o Twitter com Python TI no Vale

Android Wallpaper

Page 40: Hackeando o Facebook e o Twitter com Python TI no Vale

TI no Vale: participantes

• Hackear participantes a partir do evento criado no Facebook

• Cruzar com a lista de presentes

• Inserir link para o perfil pessoal no Facebook

• Obs.: somente alguns participantes e com a foto na data do evento

Page 42: Hackeando o Facebook e o Twitter com Python TI no Vale

Reddit + MongoDB client

Page 43: Hackeando o Facebook e o Twitter com Python TI no Vale

Reddit client

https://gist.github.com/4126108

(by 10gen)

Page 44: Hackeando o Facebook e o Twitter com Python TI no Vale

Reddit client

Page 45: Hackeando o Facebook e o Twitter com Python TI no Vale

MongoDB == JSON

Flexible Schema

Page 46: Hackeando o Facebook e o Twitter com Python TI no Vale

Relational DB

Page 47: Hackeando o Facebook e o Twitter com Python TI no Vale

Reddit MongoDB client

https://gist.github.com/4126471

Page 48: Hackeando o Facebook e o Twitter com Python TI no Vale

Reddit MongoDB client