Twitter en ballon
Sommaire
-
Introduction
-
Les bases du code
-
Connexion avec Twitter
Classico
#psg #victoire
#om #victoire
Raspberry Pi
Micro-ordinateur
- HDMI
- USB
- Ethernet
- MicroSD
- GPIO
- 700 Mhz
- 512 Mo
Ruby
irb
puts()
puts("Bonjour Ashoka")
name = "Ashoka"
puts("Bonjour " + name)
name = "Simplon"
puts("Bonjour " + name)
name.upcase()
name.blue()
load "color.rb"
name.red()
name.green()
name.blue()
name.gray()
score = 0
score += 1
Bonjour
Hello
country = "France"
if country.include("France")
puts("Bonjour")
end
country = "England"
if country.include("France")
puts("Bonjour")
elsif country.include("England")
puts("Hello")
end
team = ["psg", "om"]
API Twitter
psg = 0
om = 0
Twitter.when(["#psg","#om"]) do |tweet|
puts(tweet)
end
ruby app.rb
Twitter.when(["#psg","#om"]) do |tweet|
puts(tweet)
if tweet.include(["#psg","#victoire"])
psg += 1
end
end
Twitter.when(["#psg","#om"]) do |tweet|
puts(tweet)
if tweet.include(["#psg","#victoire"])
psg += 1
elsif tweet.include(["#om", "#victoire"])
om += 1
end
puts("Pronostic PSG:" + psg.to_s + " OM:" + om.to_s)
end
Twitter.when(["#LaPoste", "#GroupeLaPoste"]) do |tweet|
puts(tweet)
if tweet.include(["merci", "super", "bravo"])
Led.green()
elsif tweet.include(["#GroupeLaPoste"])
Led.blue()
else tweet.include(["#LaPoste"])
Led.yellow()
end
end
Bravo
Copy of Twitter en lumière (Bayard)
By aghaniyassin
Copy of Twitter en lumière (Bayard)
- 1,021