SlideShare uma empresa Scribd logo
1 de 70
Baixar para ler offline
Importação e
distribuição de tweets
para produtos globo.com
2
Ícaro Heimig
@icaromh
3
4
5
6
“
e daí? e o twitter?
7
8
Rock in Rio
2017
12/setembro ~ 25/setembro
9
1647
tweets
210
posts
10
3723
4 anos
1647
13 dias
“
11
E por que usar o
twitter?
VPN
já usou em um celular?
1
publicação móvel
aplicativo / PWA / app de terceiros
2
nome do jornalista
todos queremos aparecer um pouquinho
3
video, foto, texto, live
e tudo por conta do twitter
4
16
e como era?
17
plugin ES
descontinuado
18
renew a cada 30 min
novos @usuarios ou #hashtags
19
monolito django
código "legado"
20
instalação por produto
G1 v0.9 / gshow v0.7 / globoesporte v0.42
21
muitas soluções
cada time com a sua
“
22
TWS
(twitter subscription)
23
24
25
26
27
Requisitos!
não vai subir ninguém sem
28
29
subir units necessárias
2, 4, 8, 16, 32
30
métricas, autoscale
newrelic, zabix, logs, tsuru-auto-scale
31
planos de serviço
dbaas, rpaas, dev, prod, qa?
32
garantir high availability
blue-green deploy, healthcheck
33
suporte a produção
apresentar pra galera de infra
Restrições!
twitter </3
34
35
uma conexão ativa
mata a mais antiga
36
too many requests
ip banido
37
ordem das mensagens
delete, create, create, create, delete
from to
API HTTP
Sync em até 1 min
Flask app
Tsuru
Solução única
Plugin do ES descontinuado
Sync a cada 30 minutos
Monolito Django
Instalação por cliente
Diversas soluções
39
diagrama
de arquitetura
40
41
42
uma conexão ativa
43
unit-1 unit-2 unit-n
44
unit-1 unit-2 unit-n
45
unit-1 unit-2 unit-n
46
unit-1 unit-2 unit-n
Lock
47
48
unit-1 unit-2 unit-n
tws:lock unit-2
tws:timestamp 13819029
49
unit-1 unit-2 unit-n
tws:lock unit-2
tws:timestamp 13819030
tws:subscription users: @icaro
hashtags: #g1
50
unit-1 unit-2 unit-n
tws:lock unit-2
tws:timestamp 13819031
tws:subscription users: @icaro, @g1
hashtags: #g1
tws:app:has_update true
51
unit-1 unit-2 unit-n
tws:lock unit-1
tws:timestamp 13819032
tws:subscription users: @icaro, @g1
hashtags: #g1
tws:app:has_update false
garante uma conexão ativa
timestamp e owner no redis
timeout 3s
renew em 30s (se tiver)
52
Lock
53
garantir high availability
54
listener-thread
55
listener-thread
listener-thread[2]
56
listener-thread
listener-thread[2]
57
listener-thread
listener-thread[2]
58
listener-thread
listener-thread[2]
59
listener-thread[2]
Threading
60
abre 2 conexões com o stream
twitter mata a mais antiga
garante 0s de downtime
61
Threading
62
ordem das mensagens
delete, create, create, create, delete
63
tweet_id: 1 | action: delete
tweet_id: 2 | action: create
tweet_id: 2 | action: create
tweet_id: 1 | action: create
tweet_id: 2 | action: delete
tweet_id: 3 | action: delete
.
.
.
64
tweet_id: 1 | action: delete
tweet_id: 2 | action: create
tweet_id: 2 | action: create
tweet_id: 1 | action: create
tweet_id: 2 | action: delete
tweet_id: 3 | action: delete
.
.
.
Trace
65
66
7 dias de histórico
TODOS tweets salvos
contexto que passou
mensagem human friendly
67
Trace
Resultados
spoiler: ficou top
68
6666 tweets G1
2377 tweets GE
69
agosto ~ hoje
@icaromh
70
Obrigado

Mais conteúdo relacionado

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Importação e distribuição de tweets para produtos globo.com