- export PYTHONPATH=/Users/rolandtanglao/Documents/MOZILLA_MESSAGING/KITSUNE/TIKI_TO_KITSUNE_CONVERSION_CODE/pcraciunoiu-kitsune-531b784/apps
- get the KB article text files as .txt files from Gozer, see bug 6345657
for i in *.txt; do cat "$i" | ~/Documents/MOZILLA_MESSAGING/KITSUNE/TIKI_TO_KITSUNE_CONVERSION_CODE/kitsune/apps/sumo/convertSuMoMoKBfiles.py 1> CONVERTED_TO_KITSUNE/"$i".stdout.txt 2> CONVERTED_TO_KITSUNE/"$i".stderr.txt; done
This file contains 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
SELECT `wiki_document`.`id`, group_concat(DISTINCT `products_product`.`title` SEPARATOR ', ') as 'products', group_concat(DISTINCT `products_topic`.`title` SEPARATOR ', ') as 'topics', `wiki_document`.`title`, `wiki_revision`.`created` as 'last updated' | |
FROM `wiki_document` | |
JOIN `wiki_document_products` ON `wiki_document_products`.`document_id` = `wiki_document`.`id` | |
JOIN `wiki_document_topics` ON `wiki_document_topics`.`document_id` = `wiki_document`.`id` | |
JOIN `wiki_revision` ON `wiki_revision`.`id`= `wiki_document`.`current_revision_id` | |
JOIN `products_product` ON `products_product`.`id` = `wiki_document_products`.`product_id` | |
JOIN `products_topic` ON `products_topic`.`id` = `wiki_document_topics`.`topic_id` | |
WHERE `wiki_document`.`locale` = "en-US" | |
GROUP BY `wiki_document`.`id` |
This file contains 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
//Goes with this blog post -- http://scripting.com/2014/07/01/twitterApiUpdatewithmedia.html#aIJWTS | |
var params = { | |
url: "https://api.twitter.com/1.1/statuses/update_with_media.json", | |
oauth: { | |
consumer_key: process.env.twitterConsumerKey, | |
consumer_secret: process.env.twitterConsumerSecret, | |
token: parsedUrl.query.oauth_token, | |
token_secret: parsedUrl.query.oauth_token_secret |
This file contains 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
require 'yahoo_weatherman' | |
# get current location from user | |
def getLocation | |
puts "What is your location? Please enter city or postal code." | |
location = gets.chomp | |
end | |
# get current location from Yahoo Weatherman gem by looking it up |
This file contains 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
var db = new mongo.Db('mydatabase', new mongo.Server("127.0.0.1", 27017, {})); | |
db.open(function(e, db) { | |
get('/', function() { | |
var $this = this | |
db.collection('some-collection', function(e, col){ | |
col.find({}, {}, function(e, items) { | |
items.each(function(err, item) { | |
sys.puts(sys.inspect(item)) | |
}) |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<title>Roland's Vancouver Geotagged Cameraphone Pics</title> | |
</head> | |
<body> | |
<div id="cm-example" style="width: 800px; height: 600px"></div> | |
<script type="text/javascript" src="http://tile.cloudmade.com/wml/latest/web-maps-lite.js"></script> | |
<script type="text/javascript" src="vancouver-sample-points.js"></script> |
This file contains 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/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'xmlsimple' | |
require 'pp' | |
require 'json' | |
#pp data["variable"][6]["statistic"][0]["rgb"] # or "hex" or "value" | |
ARGF.each_line do |line| |
This file contains 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
# the trick is to escape any double quotes in the $where queries with "\" i.e %5C | |
http://localhost:27080/gs/topics/_find?criteria=%7B%22%24where%22%3A%22this.fulltext.indexOf%28%5C%22comcast%5C%22%29%20%21%3D%20-1%20%26%26%20this.fulltext.indexOf%28%5C%22send%5C%22%29%20%21%3D%20-1%22%7D&fields=%7B%22at_sfn%22%3A%221%22%7D&sort=%7B%22last_active_at%22%3A%22-1%22%7D | |
# or using CURL: | |
curl -X GET 'http://localhost:27080/gs/topics/_find?criteria=%7B%22%24where%22%3A%22this.fulltext.indexOf%28%5C%22comcast%5C%22%29%20%21%3D%20-1%20%26%26%20this.fulltext.indexOf%28%5C%22send%5C%22%29%20%21%3D%20-1%22%7D&fields=%7B%22at_sfn%22%3A%221%22%7D&sort=%7B%22last_active_at%22%3A%22-1%22%7D' |
- cd to the directory with the articles from :gozer bug 634657
- assuming all the images in articles aren't spam, then find all the unique images in the articles:
egrep -h -o '{img src="img/wiki_up/[^-]*-[^-]*-[^-]*-[^\.]*.(jpeg|jpg|png|PNG|JPG)[^&]*"[a-zA-Z0-9 &;=}]*' * | sort | uniq > unique_sumomo_images_1march_2011.txt
[file0]egrep -o '[0-9a-f]{32}-[0-9]{10}-[0-9]{1,3}-[0-9]{1}.(png|PNG|jpg|JPG|jpeg|JPEG|gif|GIF)' unique_sumomo_images_1march_2011.txt > just.unique.image.filenames.1march2011.txt
[file1]
- open up those images from :sancus bug 634667 in [file1] and see if any are spam, if so update [file1] by removing them from [file1]
- find the spam images by removing the known good images from [file1]
var=`cat /Users/rolandtanglao/Documents/MOZILLA_MESSAGING/KITSUNE/TIKI_WIKI_ARTICLES/sumo/just.unique.image.filenames.1march2011.txt`
- `grep -v "$var
This file contains 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
/** | |
* Start by cloning git://github.com/technoweenie/twitter-node, then | |
* save this file in the same directory as the clone, edit the login | |
* information, and run it with: | |
* | |
* $ node twitter-fx4.js | |
* | |
* then sit back and watch! | |
*/ | |
var twitter = require('./twitter-node/lib/twitter-node'), |
OlderNewer