This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def remove_emoji(data): | |
""" | |
去除表情 | |
:param data: | |
:return: | |
""" | |
if not data: | |
return data | |
if not isinstance(data, basestring): | |
return data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def char_error(s): | |
t = "" | |
for ch in s: | |
if random.randrange(6) == 0: | |
t += chr(ord(ch)+random.choice([-1,1])) | |
else: | |
t += ch | |
return t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I search twitter for the following strings. I'm looking specifically for questions that start with | |
// 'do you' or 'are you', but do not contain certain key words. | |
_.when( | |
search('"do you" -what -why -who -where -which -when -how'), | |
search('"are you" -what -why -who -where -which -when -how') | |
) | |
.done(function(doYou,areYou) { | |
// I take the raw search results and I snip away | |
// the "do you" or "are you" and just grab the rest of the sentence. So "Are you a magician?" becomes | |
// "a magician". I collect a bunch of these. (I strip away "what" and similar, because "what are you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.footnote-button { position: relative; z-index: 5; top: -0.15em; box-sizing: border-box; display: inline-block; padding: 0.34em; margin: 0 0.1em 0 0.2em; border: none; border-radius: 0.3em; cursor: pointer; opacity: 0.3; background-color: #464646; line-height: 0; vertical-align: middle; text-decoration: none; -webkit-transition-property: opacity; -moz-transition-property: opacity; -ms-transition-property: opacity; transition-property: opacity; -webkit-transition-duration: 0.25s; -moz-transition-duration: 0.25s; -ms-transition-duration: 0.25s; transition-duration: 0.25s; } | |
.footnote-button:hover { opacity: 0.6; } | |
.footnote-button:active { opacity: 0.6; } | |
.footnote-button.active { opacity: 0.9; -webkit-transition-delay: 0.15s; -moz-transition-delay: 0.15s; -ms-transition-delay: 0.15s; transition-delay: 0.15s; } | |
.footnote-circle { display: inline-block; width: 0.32em; height: 0.32em; margin-right: 0.224em; border-radius: 100%; background-color: #e6e6e6; border: none; line-height: 0.5em; } | |
.footnote-circle:last- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/local/perl | |
use Net::Twitter; | |
use Data::Dumper; | |
use LWP::Simple; | |
# get API credentials at http://dev.twitter.com | |
my $nt = Net::Twitter->new( | |
traits => [qw/API::RESTv1_1/], |