Permalink
Browse files

eyeo archived version, lots of fixes and improvements

  • Loading branch information...
1 parent 61e0e79 commit 597be372f8ee1ad9833aa4750847ac890811c16f @MoritzStefaner committed Jul 4, 2011
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,58 @@
+<!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" lang="en" xml:lang="en">
+
+ <head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>revisit #eyeo . moritz.stefaner.eu</title>
+
+ <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
+ <script type="text/javascript" src="lib/jquery.js"></script>
+ <script type="text/javascript" src="lib/swfobject/swfobject.js"></script>
+ <script src="lib/swfaddress/swfaddress.js" type="text/javascript" charset="utf-8"></script>
+
+ <script type="text/javascript">
+ var paramNames = ["searchterms", "appTitle", "maxItems", "showOnlyToday"];
+
+ function embedFlash(){
+
+ var flashvars = {
+
+ };
+
+ var URL="revisit_eyeo.swf";
+ var flashID = "flash";
+ var width = "100%";
+ var height = "100%";
+ var flashVersion = "10.0.0";
+ var expressInstallURL = "lib/swfobject/expressInstall.swf";
+
+ var params = {
+ allowfullscreen: "true",
+ salign: "tl"
+ };
+
+ var attributes = {
+ };
+
+ swfobject.embedSWF(URL, flashID, width, height, flashVersion, expressInstallURL, flashvars, params, attributes);
+ }
+
+ embedFlash();
+
+
+ </script>
+
+ </head>
+
+<body style="width:100%; height:100%; margin:0; padding:0; background:#000000;">
+ <div id="flashcontainer" style="width:100%; height:100%; margin:0; padding:0; background:#000000;">
+ <div id="flash" style="width:100%; height:100%; margin:0; padding:0; background:#000000;">
+ <a href="http://www.adobe.com/go/getflashplayer">
+ <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
+ </a>
+ </div>
+ </div>
+</body>
+
+</html>
View
Binary file not shown.
View
Binary file not shown.
View
Binary file not shown.
@@ -302,9 +302,9 @@ package com.swfjunkie.tweetr.utils {
var seconds : Number;
var timezone : Number;
- if (created_at.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g).length == 1) {
+ if (created_at.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/g).length == 1 || created_at.match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/g).length == 1) {
// match 2008-12-07T16:24:24Z
- tp = created_at.split(/[-T:Z]/g);
+ tp = created_at.split(/[-T:Z]|\ /g);
year = tp[0];
month = tp[1];
date = tp[2];
@@ -350,7 +350,7 @@ package com.swfjunkie.tweetr.utils {
}
time.setUTCFullYear(year, month, date);
- time.setUTCHours(hour, minutes, seconds);
+ time.setUTCHours(hour-5, minutes, seconds);
return time;
}

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1 @@
+package eu.stefaner.revisit { import flare.util.Strings; import flash.events.Event; import flash.net.FileReference; import flash.net.URLLoader; import flash.net.URLRequest; /** * @author mo */ public class EyeoApp extends App { private static const SAVE_SELECTED : Boolean = false; private var loader : URLLoader; public function EyeoApp() { App.appMode = REPLAY; Settings.maxItems = 400; Settings.searchterms = ["eyeo", "@eyeofestival"]; Settings.appTitle = "#eyeo"; super(); TweetSprite.baseScale = .66; Settings.baseScaleGrow = Settings.baseScaleShrink = 0; } override protected function loadData() : void { if (!loader) { loader = new URLLoader(); // loader.load(new URLRequest("data/eyeotweets.txt")); loader.load(new URLRequest("data/eyeotweets_400.txt")); loader.addEventListener(Event.COMPLETE, onDataLoaded); } else { searchMode = App.LIVEUPDATES; resetAdvanceTimer(); } } private function onDataLoaded(event : Event) : void { var s : String = event.target.data; var a : Array = s.split("\-\n"); trace(a.length + " tweets loaded", ""); /* author=creativeapps id=tag:search.twitter.com,2005:83929594540982272 published=2011-06-23 16:09:09 source=twitter title=@moritz_stefaner I'd love to but plane tickets are just too expensive... / have a great time! - Dave is a fantastic host /cc @eyeofestival url=http://twitter.com/creativeapps/statuses/83929594540982272 */ var results : Array = []; var td : TweetData; displayStatus(results.length + " tweets loaded"); var tweets : Array = []; for each (var l:String in a) { try { var o : * = {}; var aa : Array = l.split("\n"); for each (var l2:String in aa) { var aaa : Array = l2.split("="); o[aaa.shift()] = aaa.join("="); } var td : TweetData = new TweetData(); td.id = o.id; td.link = o.url || ""; td.text = o.title || ""; td.createdAt = o.published; td.user = o.author; td.userLink = o.author; td.userName = o.author; if (td.date.date < 26 || td.date.date > 30 ) continue; tweets.push(td); td.props.originalDataString = l; td.userProfileImage = Strings.format("http://api.twitter.com/1/users/profile_image/{0}?size=bigger", o.author); } catch(error : Error) { } // trace(o.title); } tweets.sortOn("dateTime", Array.NUMERIC); for each (var td:TweetData in tweets) { visualization.addTweetSprite(td, true); } var output : String = ""; if (SAVE_SELECTED) { visualization.checkForTooManyTweets(ts); for each (var ts:TweetSprite in visualization.data.nodes) { output += ts.data.props.originalDataString + "\n-\n"; } new FileReference().save(output, "eyeotweets_" + Settings.maxItems + ".txt"); } // searchMode = App.LIVEUPDATES; resetAdvanceTimer(); } }}
@@ -1 +1 @@
-/* Copyright 2010, Moritz StefanerLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. */package eu.stefaner.revisit { import flare.util.Dates; import com.swfjunkie.tweetr.Tweetr; /** * @author mo */ public class Settings { // externally configurable public static var maxItems : int = 300; public static var showOnlyToday : Boolean = false; public static var twitterProxyURL : String; public static var searchterms : Array = ["@twitter"]; public static var appTitle : String; // internal // public static var minDate : Date = Dates.roundTime(new Date(), Dates.DAYS); public static var minDate : Date = null; public static var maxDate : Date = null; public static var resultsPerPage : int; public static var numPreloadPages : int; public static var advanceSteps : int = 1; public static var windowSize : int = 0; public static var minSpacing : Number = 5; public static var transitionLength : Number = 1; public static var advanceTime : Number = 6000; public static var loadTime : Number = 10000; public static var retweetColor : uint = 0xFF32CCFF; public static var atReplyColor : uint = 0xFF99FF99; public static var showStatus : Boolean = true; public static var tweetConnectionAlpha : Number = .33; public static var tweetConnectionDimmedAlpha : Number = .16; public static var tweetConnectionCollapsedAlpha : Number = .66; public static var focusWindowWidth : Number = 600; public static var minAxisWidth : Number = 150; // see 5 special public static var STANDALONE : Boolean = false; public static function overwriteDefaults(params : Object) : void { if (params) { // overwrite defaults maxItems = params.maxItems || maxItems ; resultsPerPage = Math.min(100, maxItems); numPreloadPages = Math.ceil(maxItems / resultsPerPage); showOnlyToday = (params.showOnlyToday == "true") || showOnlyToday; twitterProxyURL = params.twitterProxyURL || twitterProxyURL ; if (params.searchterms) { searchterms = params.searchterms.split(","); } appTitle = params.appTitle || appTitle; } if (showOnlyToday) { minDate = Dates.addHours(Dates.roundTime(new Date(), Dates.DAYS), 7); } if (twitterProxyURL) { Tweetr.URL_TWITTER_SEARCH_OVERRIDE = twitterProxyURL; } if (!appTitle) { appTitle = searchterms.join(","); } } }}
+/* Copyright 2010, Moritz StefanerLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. */package eu.stefaner.revisit { import flare.util.Dates; import com.swfjunkie.tweetr.Tweetr; /** * @author mo */ public class Settings { // externally configurable public static var maxItems : int = 300; public static var showOnlyToday : Boolean = false; public static var twitterProxyURL : String; public static var searchterms : Array = ["@twitter"]; public static var appTitle : String; // internal // public static var minDate : Date = Dates.roundTime(new Date(), Dates.DAYS); public static var minDate : Date = null; public static var maxDate : Date = null; public static var resultsPerPage : int; public static var numPreloadPages : int; public static var advanceSteps : int = 1; public static var windowSize : int = 0; public static var minSpacing : Number = 5; public static var transitionLength : Number = 1; public static var advanceTime : Number = 6000; public static var loadTime : Number = 10000; public static var retweetColor : uint = 0xFF32CCFF; public static var atReplyColor : uint = 0xFF99FF99; public static var showStatus : Boolean = true; public static var tweetConnectionAlpha : Number = .33; public static var tweetConnectionDimmedAlpha : Number = .16; public static var tweetConnectionCollapsedAlpha : Number = .66; public static var focusWindowWidth : Number = 600; public static var minAxisWidth : Number = 150; // see 5 special public static var STANDALONE : Boolean = false; public static var baseScaleShrink : Number = .05; public static var baseScaleGrow : Number = .05; public static var baseScaleMin : Number = .5; public static var baseScaleMax : Number = 2; public static function overwriteDefaults(params : Object) : void { if (params) { // overwrite defaults maxItems = params.maxItems || maxItems ; resultsPerPage = Math.min(100, maxItems); numPreloadPages = Math.ceil(maxItems / resultsPerPage); showOnlyToday = (params.showOnlyToday == "true") || showOnlyToday; twitterProxyURL = params.twitterProxyURL || twitterProxyURL ; if (params.searchterms) { searchterms = params.searchterms.split(","); } appTitle = params.appTitle || appTitle; } if (showOnlyToday) { minDate = Dates.addHours(Dates.roundTime(new Date(), Dates.DAYS), 7); } if (twitterProxyURL) { Tweetr.URL_TWITTER_SEARCH_OVERRIDE = twitterProxyURL; } if (!appTitle) { appTitle = searchterms.join(","); } } }}
@@ -1,103 +1 @@
-/*
-
- Copyright 2010, Moritz Stefaner
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- */
-
-package eu.stefaner.revisit {
-
- import com.swfjunkie.tweetr.data.objects.SearchResultData;
- import com.swfjunkie.tweetr.utils.TweetUtil;
-
- /**
- * @author mo
- */
- public class TweetData {
-
- // from SearchResultData
- public var id : Number;
- public var link : String;
- private var _text : String;
- private var _createdAt : String;
- public var userProfileImage : String;
- public var user : String;
- public var userLink : String;
- // custom
- public var date : Date;
- public var references : Array;
- public var retweets : Array;
- public var simpleText : String;
- public var dateTime : Number;
- public var random : Number = Math.random();
- public var userName : String;
-
- public function TweetData() {
- }
-
- public static function parseSearchResult(tweet : SearchResultData) : TweetData {
- var td : TweetData = new TweetData();
- td.id = tweet.id;
- td.link = tweet.link;
- td.text = tweet.text;
- td.createdAt = tweet.createdAt;
- td.userProfileImage = tweet.userProfileImage;
- td.user = tweet.user;
- td.userLink = tweet.userLink;
- td.userName = tweet.user.split(" ")[0].toLowerCase();
- return td;
- }
-
- public function get createdAt() : String {
- return _createdAt;
- }
-
- public function set createdAt(c : String) : void {
- _createdAt = c;
- date = TweetUtil.returnTweetDate(c);
- dateTime = date.time;
- }
-
- public function get text() : String {
- return _text;
- }
-
- public function set text(text : String) : void {
- _text = text;
- processText();
- }
-
- private function processText() : void {
- var refRE : RegExp = /[@]+[A-Za-z0-9-_]+/g;
- var rtRE : RegExp = /(RT |via )[@]+[A-Za-z0-9-_]+/g;
- var tempText : String = text;
-
- retweets = tempText.match(rtRE);
- tempText = tempText.replace(rtRE, "");
-
- references = tempText.match(refRE);
-
- simpleText = text;
- simpleText = simpleText.replace(rtRE, "");
- simpleText = simpleText.replace(refRE, "");
-
- simpleText = simpleText.replace(/\W/g, "");
- simpleText = simpleText.toLowerCase();
- }
-
- public function isRetweetOf(t : TweetData) : Boolean {
- return simpleText.indexOf(t.simpleText.substring(0, 10)) > -1;
- }
- }
-}
+/* Copyright 2010, Moritz Stefaner Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */package eu.stefaner.revisit { import flare.util.Strings; import com.swfjunkie.tweetr.data.objects.SearchResultData; import com.swfjunkie.tweetr.utils.TweetUtil; /** * @author mo */ public class TweetData { // from SearchResultData public var id : Number; public var link : String; private var _text : String; private var _createdAt : String; public var userProfileImage : String; public var user : String; public var userLink : String; // custom public var date : Date; public var references : Array; public var retweets : Array; public var simpleText : String; public var dateTime : Number; public var random : Number = Math.random(); public var userName : String; public var props : * = {}; public var htmlText : String; public function TweetData() { } public static function parseSearchResult(tweet : SearchResultData) : TweetData { var td : TweetData = new TweetData(); td.id = tweet.id; td.link = tweet.link; td.text = tweet.text; td.createdAt = tweet.createdAt; td.userProfileImage = tweet.userProfileImage; td.user = tweet.user; td.userLink = tweet.userLink; td.userName = tweet.user.split(" ")[0].toLowerCase(); // test // td.userProfileImage = Strings.format("http://api.twitter.com/1/users/profile_image/{0}?size=bigger", td.userName); return td; } public function get createdAt() : String { return _createdAt; } public function set createdAt(c : String) : void { _createdAt = c; date = TweetUtil.returnTweetDate(c); dateTime = date.time; } public function get text() : String { return _text; } public function set text(text : String) : void { _text = text; processText(); } private function processText() : void { var refRE : RegExp = /[@]+[A-Za-z0-9-_]+/g; var rtRE : RegExp = /(RT |via )[@]+[A-Za-z0-9-_]+/g; var tempText : String = text || ""; retweets = tempText.match(rtRE); tempText = tempText.replace(rtRE, ""); references = tempText.match(refRE); simpleText = text; simpleText = simpleText.replace(rtRE, ""); simpleText = simpleText.replace(refRE, ""); simpleText = simpleText.replace(/\W/g, ""); simpleText = simpleText.toLowerCase(); htmlText = text.replace(/(http(s)?:\/\/((\d+\.\d+\.\d+\.\d+)|(([\w-]+\.)+([a-z,A-Z][\w-]*)))(:[1-9][0-9]*)?(\/([\w-.\/:%+@&=]+[\w- .\/?:%+@&=]*)?)?(#(.*))?)/gi, "<a href='$1' target='blank'>$1</a>"); } public function isRetweetOf(t : TweetData) : Boolean { return simpleText.indexOf(t.simpleText.substring(0, 10)) > -1; } }}
Oops, something went wrong.

0 comments on commit 597be37

Please sign in to comment.