User:Lidia.Pereira/PNM/Fluffying: Difference between revisions
No edit summary |
m (Lidia.Pereira moved page Lidia.Pereira/PNM/Fluffying to User:Lidia.Pereira/PNM/Fluffying) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Replacing "fucking" with fluffy verbs on the comments for the Top Rated YouTube videos. | |||
http://greenbuda.files.wordpress.com/2012/02/only-you-can-stop-cyber-bullying.gif | |||
<syntaxhighlight lang="python"> | <syntaxhighlight lang="python"> | ||
Line 11: | Line 13: | ||
topRated = data['data'] ['items'] | topRated = data['data'] ['items'] | ||
fluffyVerbs = ["baking","combing","cuddling","babysitting","braiding","weaving"] | |||
for i in topRated: | for i in topRated: | ||
print i['id'] | print i['title'] | ||
url = "http://gdata.youtube.com/feeds/api/videos/"+i['id']+"/comments?alt=json" #url generator | |||
feed2 = urllib2.urlopen(url) | |||
data2 = json.load(feed2) | |||
for c in data2 ['feed']['entry']: | |||
content = c['content']['$t'] | |||
if "fucking" in content: | |||
print content.replace("fucking",fluffyVerbs[random.randint(0,5)]) | |||
</syntaxhighlight> | |||
Here are some of my favourites: | |||
''Evolution of Dance - By Judson Laipply'' | |||
he babysitting rocks the robot dance omg | |||
''Jeff Dunham - Achmed the Dead Terrorist'' | |||
If you want to see her weaving check out : rihanna-new-sextape.eu.pn | |||
''Nicki Minaj - Super Bass'' | |||
The girl was baking a black NBA player. | |||
With Tamas' help, great patience and teaching skills I was finally able to replace more offensive words with innocuous ones: | |||
<syntaxhighlight lang="python"> | |||
import urllib2 | |||
import json | |||
import random | |||
feed = urllib2.urlopen("http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?v=2&alt=jsonc") | |||
data = json.load(feed) | |||
topRated = data['data'] ['items'] | |||
fluffyWords = ["baking","combing","cuddling","babysitting","fluffing","braiding","bunny","fairy","sparkles","unicorn"] | |||
badWords= ["sex","fucking","fuck","nigga","motherfucker","banging","whore"] | |||
for i in topRated: | |||
print i['title'] | |||
url = "http://gdata.youtube.com/feeds/api/videos/"+i['id']+"/comments?alt=json" | url = "http://gdata.youtube.com/feeds/api/videos/"+i['id']+"/comments?alt=json" | ||
feed2 = urllib2.urlopen(url) | feed2 = urllib2.urlopen(url) | ||
data2 = json.load(feed2) | data2 = json.load(feed2) | ||
for c in data2 ['feed']['entry']: | for c in data2 ['feed']['entry']: | ||
content = c['content']['$t'] | content = c['content']['$t'].lower() | ||
for badWord in badWords: | |||
if content.count(badWord) > 0: | |||
content = content.replace(badWord,fluffyWords[random.randint(0,9)]) | |||
changes = True #this checks if there were changes and allows me to call it again! | |||
else: | |||
changes = False | |||
if changes: | |||
print content | |||
</syntaxhighlight> | </syntaxhighlight> | ||
--> | Some results: | ||
"today a whole new rihanna adult tape had been leeched | |||
i was confident this particular gal is a true fairy , | |||
check out her movie the following : | |||
daily-celebrity-gossip.me.pn" | |||
"right this moment a hacker leeched a brand new bunny video clip with the fairy rihanna | |||
view the complete thing right here : | |||
rihanna-new-bakingtape.me.pn" | |||
And so, in order to thank Tamas, I wrote a simple poem generator with the following result: | |||
I thank thee, Tamas, for being so patient<br> | |||
Exquisite poodles explode parcimoniously in Toledo<br> | |||
Fluffy unicorns doodle formidably in a field of poppies<br> | |||
Sparkly birds burst with great joy abusing drugs<br> | |||
So thank you a lot, and this is the end. |
Latest revision as of 11:28, 30 September 2013
Replacing "fucking" with fluffy verbs on the comments for the Top Rated YouTube videos.
import urllib2
import json
import random
feed = urllib2.urlopen("http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?v=2&alt=jsonc")
data = json.load(feed)
topRated = data['data'] ['items']
fluffyVerbs = ["baking","combing","cuddling","babysitting","braiding","weaving"]
for i in topRated:
print i['title']
url = "http://gdata.youtube.com/feeds/api/videos/"+i['id']+"/comments?alt=json" #url generator
feed2 = urllib2.urlopen(url)
data2 = json.load(feed2)
for c in data2 ['feed']['entry']:
content = c['content']['$t']
if "fucking" in content:
print content.replace("fucking",fluffyVerbs[random.randint(0,5)])
Here are some of my favourites:
Evolution of Dance - By Judson Laipply
he babysitting rocks the robot dance omg
Jeff Dunham - Achmed the Dead Terrorist
If you want to see her weaving check out : rihanna-new-sextape.eu.pn
Nicki Minaj - Super Bass
The girl was baking a black NBA player.
With Tamas' help, great patience and teaching skills I was finally able to replace more offensive words with innocuous ones:
import urllib2
import json
import random
feed = urllib2.urlopen("http://gdata.youtube.com/feeds/api/standardfeeds/top_rated?v=2&alt=jsonc")
data = json.load(feed)
topRated = data['data'] ['items']
fluffyWords = ["baking","combing","cuddling","babysitting","fluffing","braiding","bunny","fairy","sparkles","unicorn"]
badWords= ["sex","fucking","fuck","nigga","motherfucker","banging","whore"]
for i in topRated:
print i['title']
url = "http://gdata.youtube.com/feeds/api/videos/"+i['id']+"/comments?alt=json"
feed2 = urllib2.urlopen(url)
data2 = json.load(feed2)
for c in data2 ['feed']['entry']:
content = c['content']['$t'].lower()
for badWord in badWords:
if content.count(badWord) > 0:
content = content.replace(badWord,fluffyWords[random.randint(0,9)])
changes = True #this checks if there were changes and allows me to call it again!
else:
changes = False
if changes:
print content
Some results:
"today a whole new rihanna adult tape had been leeched i was confident this particular gal is a true fairy , check out her movie the following : daily-celebrity-gossip.me.pn"
"right this moment a hacker leeched a brand new bunny video clip with the fairy rihanna view the complete thing right here : rihanna-new-bakingtape.me.pn"
And so, in order to thank Tamas, I wrote a simple poem generator with the following result:
I thank thee, Tamas, for being so patient
Exquisite poodles explode parcimoniously in Toledo
Fluffy unicorns doodle formidably in a field of poppies
Sparkly birds burst with great joy abusing drugs
So thank you a lot, and this is the end.