se onebox could exception out

This commit is contained in:
Sam 2013-08-15 21:01:37 +10:00
parent 9e20a99afd
commit a7eea65d53
2 changed files with 6 additions and 4 deletions

View File

@ -35,10 +35,12 @@ module Oneboxer
def parse(data)
result = JSON.parse(data)['items'].first
result['creation_date'] =
Time.at(result['creation_date'].to_i).strftime("%I:%M%p - %d %b %y")
if result
result['creation_date'] =
Time.at(result['creation_date'].to_i).strftime("%I:%M%p - %d %b %y")
result['tags'] = result['tags'].take(4).join(', ')
result['tags'] = result['tags'].take(4).join(', ')
end
result
end

View File

@ -47,7 +47,7 @@
});
}
var options = []
var options = [];
var i;
for (i=0; i < emoji.length; i++) {
if (emoji[i].indexOf(term) === 0) {