Project

General

Profile

Defect #278 ยป retweet_error.txt

Robert Ivens, 04/26/2011 12:42 AM

 
1
JavaException: net.stuff.servoy.plugins.twitter.utils.TwitterPluginException: org.json.JSONException: A JSONObject text must begin with '{' at character 1 of <!DOCTYPE html>
2
<html>
3
  <head>
4
    <title>Twitter / ?</title>
5
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
    <meta charset="utf-8" />
7

    
8
    <script type="text/javascript" charset="utf-8">
9
      // this must be set before any other script is loaded for IE7 security
10
      document.domain = 'twitter.com';
11
      var twttr = {};
12
      twttr.versionName = 'phoenix';
13
      // this will be copied to twttr.appStartTime once our JS has started up
14
      document.startTime = new Date().getTime();
15
    </script>
16

    
17
    <script>
18
function bust () {
19
  document.write = "";
20
  window.top.location = window.self.location;
21
  setTimeout(function() {
22
    document.body.innerHTML = '';
23
    }, 0);
24
  window.self.onload = function(evt) {
25
    document.body.innerHTML = '';
26
  };
27
}
28
if (window.top !== window.self) { // are you trying to put self in an iframe?
29
  try {
30
    if (window.top.location.host) { // this is illegal to access unless you share a non-spoofable document domain
31
      // fun times
32
    } else {
33
      bust(); // chrome executes this
34
    }
35
  } catch (ex) {
36
    bust(); // everyone executes this
37
  }
38
}
39
</script>
40

    
41
    <link href="/phoenix/favicon.ico" rel="shortcut icon" type="image/x-icon" />
42
    <link rel="stylesheet" href="http://a2.twimg.com/a/1303425044/phoenix/css/phoenix.bundle.css" type="text/css" media="screen" />
43
    <!-- basic RSS hoopla -->
44
      <link rel="http://oexchange.org/spec/0.8/rel/related-target" href="http://twitter.com/oexchange.xrd" type="application/xrd+xml" />
45
      <link rel="alternate" href="http://twitter.com/favorites/198796585.rss" title="Your Twitter Favorites" type="application/rss+xml" />
46
    <noscript>
47
        <meta http-equiv=refresh content="0; URL=/162646694319374336.json?_twitter_noscript=1" />
48
      </noscript>
49
    
50
    <script type="text/javascript">
51

    
52
  var _gaq = _gaq || [];
53
  _gaq.push(['_setAccount', 'UA-30775-6']);
54
  _gaq.push(
55
    ['_trackPageview'],
56
    ['_setDomainName', 'twitter.com']
57
  );
58

    
59
  (function() {
60
    var ga = document.createElement('script');
61
    ga.type = 'text/javascript';
62
    ga.async = true;
63
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
64
    var s = document.getElementsByTagName('script')[0];
65
    s.parentNode.insertBefore(ga, s);
66
  }());
67

    
68
  twttr.trackPageView = function(pathName) {
69
    var event = ['_trackPageview'];
70
    if (pathName) {
71
      event.push(pathName);
72
    }
73
    _gaq.push(event);
74
  };
75

    
76
</script>
77
  </head>
78
  <body class="user-style-twttr  loading-body ">
79
    <div id="doc">
80
      <div id="top-stuff">
81
        <div id="banners" style="clear:both;"></div>
82
        <div id="top-bar-outer">
83
          <div id="top-bar-bg"></div>
84
          <div id="top-bar">
85
            <div class="top-bar-inside">
86
              <div class="static-links">
87
  <div id="logo">
88
    <a href="/">Twitter</a>
89
  </div>
90
  <form id="search-form" action="/search" method="GET">
91
    <span class="glass left"><i></i></span>
92
    <input value="" placeholder="Search" name="q" id="search-query" type="text" />
93
  </form>
94
  <div id="global-nav">
95
    <ul>
96
      <li id="global-nav-home"><a href="/">Home</a></li>
97
          <li id="global-nav-profile"><a href="/ROCLASI">Profile</a></li>
98
          <li id="global-nav-messages"><a href="/messages">Messages</a></li>
99
          <li id="global-nav-whotofollow"><a href="/#!/who_to_follow">Who To Follow</a></li>
100
      </ul>
101
  </div>
102
  <div id="sections"></div>
103
</div>
104
<div class="active-links">
105
  <div id="session" class="loggedin">
106
      <a class="profile-links" href="#">
107
        <span id="profile-image"><img src="http://a1.twimg.com/profile_images/1137812960/roclasi_normal.png" /></span>
108
      </a>
109
      <span id="screen-name">
110
        ROCLASI
111
      </span>&nbsp;<span id="screen-name-dropdown">&nbsp;</span>
112
      <div class="dropdown">
113
        <ul class="user-dropdown">
114
  <li><a href="/settings/account">Settings</a></li>
115
    <li><a href="http://support.twitter.com">Help</a></li>
116

    
117
    <li>
118
        <form method="post" action="/account/use_phx" class="turn-phx-off-form">
119
          <input type="hidden" name="setting" value="false">
120
          <input type="hidden" name="format" value="html">
121
          <input type='hidden' value='f37e2730fb6e66d0441a577d9e9b409a6454e34c' name='authenticity_token'>
122
          <button type="submit" class="turn-phx-off-button">Switch to Old Twitter</button>
123
        </form>
124
      </li>
125
    <li>
126
      <form class="signout-form" action="/logout" method="POST">
127
        <a class="signout-button" href="#">Sign out</a>
128
        <input type='hidden' value='f37e2730fb6e66d0441a577d9e9b409a6454e34c' name='authenticity_token'/>
129
      </form>
130
    </li>
131

    
132
    </ul>
133

    
134
      </div>
135
    </div>
136
    <span class="vr"></span>
137
    <a id="new-tweet" title="New Tweet"><span>New Tweet</span></a>
138
  </div>
139
            </div>
140
          </div>
141
          <div id="message-drawer"></div>
142
        </div>
143
      </div>
144

    
145
      <div id="page-outer">
146

    
147
        <div id="page-container" class="fof-container">
148
          <div>
149
              <div class="four-oh-four">
150
  </div>
151
              </div>
152
        </div>
153
      </div>
154

    
155
      <div id="message-notifications"></div>
156
    </div>
157

    
158
    <div id="flash-message-storage" style="display:none"></div>
159

    
160
    <script type="text/javascript">
161
      /* Degrade gracefully if the browser doesn't support console.log */
162
      if (!window.console) {
163
        (function() {
164
          var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
165
          "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
166

    
167
          window.console = {};
168
          for (var i = 0; i < names.length; ++i) {
169
            window.console[names[i]] = function() {};
170
          }
171
        }());
172
      }
173
    </script>
174

    
175
    <script type="text/javascript">(function () {
176
  // patch some IE things
177
  window.setTimeout = window.setTimeout;
178
  window.setInterval = window.setInterval;
179

    
180
  window.WATCH = function (label, block) {
181
    if (typeof block === 'undefined') {
182
      block = label;
183
      label = undefined;
184
    }
185
    if (typeof label === 'string') {
186
      WATCH._didExecute[label] = true;
187
    }
188

    
189
    WATCH._attempt(this, block);
190
  };
191
  WATCH._didExecute = {};
192

    
193
  WATCH._reportCount = 0;
194

    
195
  WATCH._reportLimit = 25;
196

    
197
  WATCH._reportInterval = 60 * 1000;
198
  WATCH._active = false;
199
  WATCH.activate = function (setting) {
200
    if (typeof setting === 'undefined'){
201
      setting = true;
202
    }
203
    WATCH._active = setting;
204
    extend(WATCH, WATCH._active ? WATCH.actives : WATCH.inactives)
205
  };
206

    
207
  WATCH.actives = {};
208
  WATCH.inactives = {};
209

    
210
  var extend = function(destination, source){
211
    for (var key in source){
212
      destination[key] = source[key];
213
    }
214
  }
215

    
216
  var noop = function(){};
217

    
218
  WATCH._attempt = function(that, block) {
219
    if (arguments.length < 2) {
220
      block = that;
221
      that = window;
222
    }
223

    
224
    if (WATCH._active) {
225
      try {
226
        block.apply(that);
227
      } catch (error) {
228
        WATCH._triggerError(error);
229
      }
230
    } else {
231
      block.apply(that);
232
    }
233
  };
234

    
235
  WATCH.inactives.end = noop;
236
  WATCH.actives.end = function (label) {
237
    if (typeof label === 'undefined') {
238
      throw new Error('WATCH.end() requires a label');
239
    }
240
    if (WATCH._didExecute[label]) {
241
      WATCH._didExecute[label] = false;
242
    } else if (WATCH._active) {
243
      WATCH._triggerError(new Error('WATCH.end("'+label+'") called without successful call to WATCH("'+label+'", fn(){...}) - a SyntaxError probably just happened'));
244
    }
245
    WATCH._didExecute[label] = false;
246
  };
247

    
248
  /**
249
   *  Given a function, return a version of that function that is wrapped by the WATCH function.
250
   */
251
  WATCH.inactives.callback = function(that, callback){
252
    // pass the callback through
253
    return typeof callback === 'undefined' ? that : callback;
254
  };
255
  WATCH.actives.callback = function (that, callback) {
256
    if (arguments.length === 1) {
257
      callback = that;
258
      that = this;
259
    }
260

    
261
    if (typeof callback === 'string') {
262
      callback = (function (stringVersion) {
263
        return function () {
264
          eval(stringVersion);
265
        };
266
      }(callback));
267
    }
268

    
269
    var watchedCallback = function () {
270
      var that = this,
271
          args = arguments,
272
          result;
273

    
274
      WATCH._attempt(function () {
275
        result = callback.apply(that, args);
276
      });
277
      return result;
278
    };
279

    
280
    watchedCallback.isWatched = true;
281
    return watchedCallback;
282
  };
283

    
284
  WATCH._onErrorCallbacks = {};
285

    
286
  WATCH.inactives._addOnError = noop;
287
  WATCH.actives._addOnError = function (callback) {
288
    var unique = WATCH._unique();
289
    WATCH._onErrorCallbacks[unique] = callback;
290
    return unique;
291
  };
292

    
293
  WATCH.inactives._removeOnError = noop;
294
  WATCH.actives._removeOnError = function (id) {
295
    delete WATCH._onErrorCallbacks[id];
296
  };
297

    
298
  WATCH._lastUnique = -1;
299
  WATCH._unique = function () {
300
    return ++WATCH._lastUnique;
301
  };
302

    
303
  WATCH.inactives.jQuery = noop;
304
  WATCH.actives.jQuery = function () {
305
    //  Wrap jQuery's event binding code so all event handlers are wrapped
306
    WATCH._originalJQueryEventAdd = WATCH._originalJQueryEventAdd || jQuery.event.add;
307
    jQuery.event.add = function () {
308
      var newArgs = Array.prototype.slice.call(arguments);
309

    
310
      if (typeof newArgs[2] === 'function') {
311
        newArgs[2] = WATCH.callback(newArgs[2]);
312
      } else if (newArgs && typeof newArgs[2] === 'object' && newArgs[2].handler) {
313
        newArgs[2].handler = WATCH.callback(newArgs[2].handler);
314
      }
315
      return WATCH._originalJQueryEventAdd.apply(this, newArgs);
316
    };
317

    
318
    WATCH._originalJQueryAjax = WATCH._originalJQueryAjax || jQuery.ajax;
319
    jQuery.ajax = function (options) {
320
      jQuery.each(['complete', 'error', 'success'], function (which, key) {
321
        if (!options[key]) {
322
          return;
323
        }
324
        options[key] = WATCH.callback(options[key]);
325
      });
326

    
327
      return WATCH._originalJQueryAjax.apply(this, arguments);
328
    };
329
  };
330
  WATCH.inactives.undoJQuery = noop;
331
  WATCH.actives.undoJQuery = function() {
332
    jQuery.event.add = WATCH._originalJQueryEventAdd;
333
    jQuery.ajax = WATCH._originalJQueryAjax;
334
  };
335

    
336
  WATCH._previousErrors = {};
337

    
338
  var escapeDoubleQuotes = function (string) {
339
    return string.toString().replace('"', '\\"');
340
  };
341

    
342
  var stringifyLite = function (object) {
343
    var result = '{', hasProperty = false;
344
    for (var key in object) {
345
      if(typeof object[key] === 'undefined' || object[key] === null){
346
        continue;
347
      }
348
      result += (hasProperty ? ',"' : '"') + escapeDoubleQuotes(key) + '":"' + escapeDoubleQuotes(object[key]) + '"';
349
      hasProperty = true;
350
    }
351
    return result + '}';
352
  };
353

    
354
  WATCH._scribeError = function(report) {
355
    if(WATCH._previousErrors[report.error] && (new Date()) - WATCH._previousErrors[report.error] < WATCH._reportInterval) {
356
      //  We've recently logged this; don't log it again
357
      return false;
358
    }
359

    
360
    if(WATCH.reportLimit <= WATCH.reportCount){
361
      return;
362
    }
363

    
364
    WATCH.reportCount++;
365

    
366
    if ( ! document.location.hostname.match(/(^(www|api)\.)?twitter\.com$/) ) {
367
      return;
368
    }
369

    
370
    WATCH._previousErrors[report.error] = new Date();
371

    
372
    report.product_name = 'webclient';
373
    report.type = 'js_error';
374
    report.url = window.location.href;
375
    report.event_name = "test";
376

    
377
    var isProduction = document.location.hostname.match(/(^(www|api|staging\d+.local)\.)twitter\.com$/) != null;
378
    var scribeHost = isProduction ? 'scribe.twitter.com' : window.location.host;
379
    var scribeUrl = (window.location.protocol.match(/s\:$/) ? 'https' : 'http') + '://' + scribeHost;
380
    scribeUrl += isProduction ? '/' : '/scribe';
381
    scribeUrl += '?category=client_watch_error&log=' + encodeURIComponent(stringifyLite(report)) + '&ts=' + (new Date()).getTime();
382

    
383
    (new Image()).src = scribeUrl;
384
  };
385

    
386
  WATCH._triggerError = function(error) {
387
    var reraise = true;
388

    
389
    var report = {
390
      error: error
391
    };
392

    
393
    for (var key in WATCH._onErrorCallbacks) {
394
      try {
395
        if (WATCH._onErrorCallbacks[key](report) === false) {
396
          reraise = false;
397
        }
398
      } catch (callbackError) {
399
        report.callbackFailure = true;
400
      }
401
    }
402
    WATCH._scribeError(report);
403
    if(reraise){
404
      throw error;
405
    }
406
  };
407

    
408
  /**
409
   *  Wrap built-in functions with versions that WATCH for errors as appropriate.
410
   */
411
  WATCH.inactives.natives = noop;
412
  WATCH.actives.natives = function () {
413
    window.setInterval = WATCH._watchedSetInterval;
414
    window.setTimeout = WATCH._watchedSetTimeout;
415
  };
416

    
417
  WATCH.inactives.undoNatives = noop;
418
  WATCH.actives.undoNatives = function () {
419
    window.setInterval = WATCH._originalSetInterval;
420
    window.setTimeout = WATCH._originalSetTimeout;
421
  };
422

    
423
  WATCH._originalSetInterval = window.setInterval;
424
  WATCH._originalSetTimeout = window.setTimeout;
425

    
426
  //  Wrap setInterval and setTimeout, which run code asyncronously and therefore allow it
427
  //  to escape any existing try/catch blocks.
428

    
429
  //  Rebind window.setInterval and .setTimeout
430
  WATCH._watchedSetInterval = function (callback, timeout) {
431
    // in IE, native functions have no .call().
432
    // we have to bind to a local var in order to get them to run in the context of window
433
    var setInterval = WATCH._originalSetInterval;
434
    return setInterval(WATCH.callback(callback), timeout);
435
  };
436

    
437
  WATCH._watchedSetTimeout = function (callback, timeout) {
438
    // in IE, native functions have no .call().
439
    // we have to bind to a local var in order to get them to run in the context of window
440
    var setTimeout = WATCH._originalSetTimeout;
441
    return setTimeout(WATCH.callback(callback), timeout);
442
  };
443

    
444
  WATCH.activate(false);
445
}());
446
</script>
447
    <script type="text/javascript">
448
      WATCH._addOnError(function(errorReport) {
449
        if (document.body.className.indexOf("loading-body") !== -1) {
450
          errorReport.dead = true;
451
        }
452
      });
453
    </script>
454

    
455
    <script type="text/javascript">WATCH('loadrunner', function() {
456
        (function loadrunner(E){var V=E.document;var H=V.getElementsByTagName("script"),M,J;var b={},I={},U;for(var Y=0,R;R=H[Y];Y++){if(R.src.match(/loadrunner\.js(\?|#|$)/)){M=R;break}}function C(e){if(e.length>0){return e.replace(/\/$/,"")+"/"}return""}function N(e){return Array.prototype.slice.call(e)}function B(e,f){for(var g=0,h;h=e[g];g++){if(f==h){return g}}return -1}function S(e){return !!e.match(/^(([a-zA-Z0-9\-_]+)\/)*[a-zA-Z0-9\-_]+$/)||!Z(e)}function O(e){return !!e.match(/^(([a-zA-Z0-9\-_]+)\/)*[a-zA-Z0-9\-_]+$/)}function Z(e){return !e.match(/^>/)}function Q(e){return[C(X.path),e,".js"].join("")}function D(e){if(e.match(/^(https?)?:?\/\//)){return e}if(e.match(/^\/[^\/]/)){return C(X.docRoot)+e}if(e.match(/^\$/)){return C(X.path)+e.replace(/^\$/,"")}return e}function P(f){var e;if(e=I[f]){return e}else{return f}}function F(){}F.prototype.addCallback=function(e){if(this.completed){e.apply(this,this.results)}else{this.callbacks=this.callbacks||[];this.callbacks.push(e)}};F.prototype.complete=function(){if(!this.completed){this.results=N(arguments);this.completed=true;if(this.callbacks){for(var f=0,e;e=this.callbacks[f];f++){e.apply(window,this.results)}}}};function d(f,e){this.id=f;var h=this;function g(i){h.exports=i;h.complete(h.exports)}if(typeof e=="function"){e(g)}else{this.exports=e;this.complete(this.exports)}X.loaded.push(f)}d.prototype=new F;var A={};function L(h,j){var i;if(!A[h]){i=new F;A[h]=i;var g=function(){delete A[h];X.loaded.push(h);i.complete(h)};if(Z(h)){var e=V.createElement("script");e.type="text/javascript";e.async=true;e.onload=g;e.onerror=function(){throw h+" not loaded"};e.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){this.onreadystatechange=null;g()}};e.src=h;var f=V.getElementsByTagName("head")[0];if(!f){f=V.createElement("head");V.documentElement.appendChild(f)}f.insertBefore(e,f.firstChild)}else{i.onManualLoad=i.onManualLoad||[];i.onManualLoad.push(g)}}else{i=A[h]}if(j){i.addCallback(j)}return i}function T(f,e){e=[].concat(e);for(var g=0,h;h=e[g];g++){I[unescape(h)]=unescape(f)}}function X(){var f=new F,e=N(arguments),k=0,q=[];for(var n=0;n<e.length;n++){if(typeof e[n].length==="number"&&e[n].splice){e=e.slice(0,n).concat(e[n]).concat(e.slice(n+1))}}function j(){k++;if(k==e.length){var s;var v=[],u={},p;for(var t=0,r;r=q[t];t++){p=b[r].exports;v.push(p);u[r]=p}f.complete.apply(f,v)}}function g(i,p){return function(){if(!b[i]){throw new Error("File "+p+" does not provide module "+i)}b[i].addCallback(function(){j()})}}if(typeof e[e.length-1]=="function"){f.addCallback(e.pop())}if(!e.length){setTimeout(function(){f.complete()},0)}for(var l=0,h;h=e[l];l++){if(S(h)){var m=P(h);var o;if(O(h)){o=Q(m)}else{o=m}q.push(h);if(B(X.loaded,h)>-1){g(h)()}else{X.load(D(o),g(h,o))}}else{if(B(X.loaded,h)>-1){j()}else{X.load(D(P(h)),j)}}}return f}X.loaded=[];X.path="";if(M){X.path=M.getAttribute("data-path")||M.src.split(/loadrunner\.js/)[0]||"";if(U=M.getAttribute("data-alias")||window.__lralias){for(var Y=0,W,c=U.split("&");W=c[Y]&&c[Y].split("=");Y++){var K=W[0],G=W[1].split(",");T(K,G)}}}X.docRoot=X.cwd="";X.reset=function(){X.loaded=[];b={}};function a(g,f){b[g]=new d(g,f);var j=A[g];if(j&&j.onManualLoad){for(var h=0,e=j.onManualLoad.length;h<e;++h){j.onManualLoad[h]()}delete j.onManualLoad}return b[g]}E.using=X;E.using.load=L;E.using.alias=T;E.provide=a;if(J=(M&&M.getAttribute("data-main"))){X.apply(E,J.split(/\s*,\s*/))}})(this);
457
      });
458
    </script>
459
    <script>WATCH.end('loadrunner');</script>
460
    <script type="text/javascript">WATCH('javascript_includes', function() {
461

    
462
  (function loadrunner(E){var V=E.document;var H=V.getElementsByTagName("script"),M,J;var b={},I={},U;for(var Y=0,R;R=H[Y];Y++){if(R.src.match(/loadrunner\.js(\?|#|$)/)){M=R;break}}function C(e){if(e.length>0){return e.replace(/\/$/,"")+"/"}return""}function N(e){return Array.prototype.slice.call(e)}function B(e,f){for(var g=0,h;h=e[g];g++){if(f==h){return g}}return -1}function S(e){return !!e.match(/^(([a-zA-Z0-9\-_]+)\/)*[a-zA-Z0-9\-_]+$/)||!Z(e)}function O(e){return !!e.match(/^(([a-zA-Z0-9\-_]+)\/)*[a-zA-Z0-9\-_]+$/)}function Z(e){return !e.match(/^>/)}function Q(e){return[C(X.path),e,".js"].join("")}function D(e){if(e.match(/^(https?)?:?\/\//)){return e}if(e.match(/^\/[^\/]/)){return C(X.docRoot)+e}if(e.match(/^\$/)){return C(X.path)+e.replace(/^\$/,"")}return e}function P(f){var e;if(e=I[f]){return e}else{return f}}function F(){}F.prototype.addCallback=function(e){if(this.completed){e.apply(this,this.results)}else{this.callbacks=this.callbacks||[];this.callbacks.push(e)}};F.prototype.complete=function(){if(!this.completed){this.results=N(arguments);this.completed=true;if(this.callbacks){for(var f=0,e;e=this.callbacks[f];f++){e.apply(window,this.results)}}}};function d(f,e){this.id=f;var h=this;function g(i){h.exports=i;h.complete(h.exports)}if(typeof e=="function"){e(g)}else{this.exports=e;this.complete(this.exports)}X.loaded.push(f)}d.prototype=new F;var A={};function L(h,j){var i;if(!A[h]){i=new F;A[h]=i;var g=function(){delete A[h];X.loaded.push(h);i.complete(h)};if(Z(h)){var e=V.createElement("script");e.type="text/javascript";e.async=true;e.onload=g;e.onerror=function(){throw h+" not loaded"};e.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){this.onreadystatechange=null;g()}};e.src=h;var f=V.getElementsByTagName("head")[0];if(!f){f=V.createElement("head");V.documentElement.appendChild(f)}f.insertBefore(e,f.firstChild)}else{i.onManualLoad=i.onManualLoad||[];i.onManualLoad.push(g)}}else{i=A[h]}if(j){i.addCallback(j)}return i}function T(f,e){e=[].concat(e);for(var g=0,h;h=e[g];g++){I[unescape(h)]=unescape(f)}}function X(){var f=new F,e=N(arguments),k=0,q=[];for(var n=0;n<e.length;n++){if(typeof e[n].length==="number"&&e[n].splice){e=e.slice(0,n).concat(e[n]).concat(e.slice(n+1))}}function j(){k++;if(k==e.length){var s;var v=[],u={},p;for(var t=0,r;r=q[t];t++){p=b[r].exports;v.push(p);u[r]=p}f.complete.apply(f,v)}}function g(i,p){return function(){if(!b[i]){throw new Error("File "+p+" does not provide module "+i)}b[i].addCallback(function(){j()})}}if(typeof e[e.length-1]=="function"){f.addCallback(e.pop())}if(!e.length){setTimeout(function(){f.complete()},0)}for(var l=0,h;h=e[l];l++){if(S(h)){var m=P(h);var o;if(O(h)){o=Q(m)}else{o=m}q.push(h);if(B(X.loaded,h)>-1){g(h)()}else{X.load(D(o),g(h,o))}}else{if(B(X.loaded,h)>-1){j()}else{X.load(D(P(h)),j)}}}return f}X.loaded=[];X.path="";if(M){X.path=M.getAttribute("data-path")||M.src.split(/loadrunner\.js/)[0]||"";if(U=M.getAttribute("data-alias")||window.__lralias){for(var Y=0,W,c=U.split("&");W=c[Y]&&c[Y].split("=");Y++){var K=W[0],G=W[1].split(",");T(K,G)}}}X.docRoot=X.cwd="";X.reset=function(){X.loaded=[];b={}};function a(g,f){b[g]=new d(g,f);var j=A[g];if(j&&j.onManualLoad){for(var h=0,e=j.onManualLoad.length;h<e;++h){j.onManualLoad[h]()}delete j.onManualLoad}return b[g]}E.using=X;E.using.load=L;E.using.alias=T;E.provide=a;if(J=(M&&M.getAttribute("data-main"))){X.apply(E,J.split(/\s*,\s*/))}})(this);
463

    
464
  twttr.loggedIn = true;
465
  twttr.session = twttr.session || {};
466

    
467
  twttr.appStartTime = document.startTime; // set in phoenix.mustache
468

    
469
  twttr.remoteIP = '83.101.7.190';
470
  twttr.requestFullCity = 'be,11,brussels';
471
  twttr.geo = twttr.geo || {};
472

    
473
  twttr.bundles = {"api":"http:\/\/a2.twimg.com\/a\/1303425044\/javascripts\/api.bundle.js","phoenix":"http:\/\/a0.twimg.com\/a\/1303425044\/javascripts\/phoenix.bundle.js","phxie6":"http:\/\/a2.twimg.com\/a\/1303425044\/javascripts\/phxie6.bundle.js","admin":"http:\/\/a1.twimg.com\/a\/1303425044\/javascripts\/admin.bundle.js","griffin":"http:\/\/a1.twimg.com\/a\/1303425044\/javascripts\/griffin.bundle.js","base":"http:\/\/a2.twimg.com\/sticky\/base.16.bundle.js","phoenix_plugins":"http:\/\/a2.twimg.com\/a\/1303425044\/javascripts\/phoenix_plugins.bundle.js"};
474

    
475
  using(
476
    '>allCurrentUserDataLoaded',
477
    '>request_cache_seeded',
478
    '>base_bundle_evaled',
479
    '>phoenix_plugins_bundle_evaled',
480
    '>phoenix_bundle_evaled',
481
    '>languageData',
482

    
483
    function () {
484
      // Manually trigger ready event, avoiding race condition where it never fires due to iframe thingy
485
      // This should be safe based on how our script loading is done
486
      jQuery.ready();
487
      twttr.setup();
488

    
489
      //  Give our session a unique impression id for profiling purposes
490
      twttr.session.impressionId = twttr.appStartTime + Math.random();
491
    }
492
  );
493

    
494
  /* -------------------- Autocomplete place data from CDN -------------------- */
495

    
496
  twttr.placeDataPrefix = "http://geo.l3.twitter.com/places/autocomplete_places-";
497

    
498
  /* -------------------- Initialize API Method -------------------- */
499

    
500
  function initAPI() {
501
    twttr.anywhere.api.initialize();
502

    
503
    twttr.API = {};
504

    
505
    twttr.aug(twttr.API, twttr.anywhere.api.models);
506
    twttr.aug(twttr.API, {
507
      globalEvents: twttr.anywhere.api.globalEvents
508
    });
509

    
510
    twttr.API.setConfig = twttr.anywhere.api.updateConfig;
511
    twttr.API.getConfig = function () {
512
      return twttr.anywhere.api.config;
513
    };
514

    
515
    if (!twttr.API.util) {
516
      twttr.API.util = {};
517
    }
518

    
519
    twttr.aug(twttr.API.util, twttr.anywhere.api.util);
520

    
521
    if (!twttr.API._requestCache) {
522
      twttr.API._requestCache = twttr.anywhere.api.cache;
523
    }
524

    
525
    twttr.API.setConfig({
526
      cacheObjects: true,
527
      includeEntities: true,
528
      postAuthenticityToken: 'f37e2730fb6e66d0441a577d9e9b409a6454e34c'
529
    });
530

    
531
    twttr.extendAPI();
532
  }
533

    
534
  /* -------------------- Init CurrentUser Method -------------------- */
535

    
536
  function initCurrentUser() {
537
    if (twttr.loggedIn) {
538
      using('>bootstrap_data', '>request_cache_seeded', function (bootstrapData) {
539
        twttr.API.User.current(function(currentUser) {
540
          twttr.currentUser = currentUser;
541

    
542
          for (var propName in bootstrapData.userProperties) {
543
            twttr.currentUser.sync(propName, bootstrapData.userProperties[propName] || false);
544
          }
545

    
546
          provide('>allCurrentUserDataLoaded');
547
        });
548
      });
549
    } else {
550
      provide('>allCurrentUserDataLoaded');
551
    }
552
  };
553

    
554
  /* -------------------- Setting up Domains -------------------- */
555

    
556
  twttr.proto = window.location.protocol.match(/s\:$/) ? 'https' : 'http';
557
  twttr.isSSL = function () {
558
    return twttr.proto === 'https';
559
  };
560

    
561
  twttr.domains = {
562
    local: 'twitter.com',
563
    remote: 'api.twitter.com'
564
  };
565

    
566
  var match = window.location.hostname.match(/^(staging\d+\.[a-zA-Z0-9_]*?)\.twitter\.com$/i);
567

    
568
  if (match) {
569
    twttr.domains.local = match[1] + '.twitter.com';
570
    twttr.domains.remote = 'api-' + match[1] + '.twitter.com';
571
  }
572

    
573
  if (document.location.hostname === "localhost.twitter.com") {
574
    twttr.domains.local = 'localhost.twitter.com:3000';
575
      twttr.domains.remote = 'api.localhost.twitter.com:3000';
576
      }
577

    
578
  twttr.hosts = {
579
    local: twttr.proto + "://" + twttr.domains.local,
580
    remote: twttr.proto + "://" + twttr.domains.remote
581
  };
582

    
583
  var pReceiverURL = twttr.hosts.remote + '/receiver.html';
584
  twttr.jsonpSandboxURL = 'http://a3.twimg.com/a/1303425044/jsonp_sandbox.html#scripts=http://a2.twimg.com/sticky/base.16.bundle.js';
585

    
586
  /* -------------------- Iframe Creator Method -------------------- */
587

    
588
  function createIFrame(complete) {
589
    var frag = document.createElement('div');
590
    frag.innerHTML = '<iframe tabindex="-1" role="presentation" style="position:absolute;top:-9999px;" src="' + pReceiverURL + '"></iframe>';
591

    
592
    var iframe = frag.firstChild;
593
    var fnComplete = function() {
594
      complete.apply(iframe, arguments);
595
    };
596

    
597
    iframe.addEventListener ? iframe.addEventListener('load', fnComplete, false) : iframe.attachEvent('onload', fnComplete);
598

    
599
    //  Avoid "operation aborted" error in IE that can be caused by
600
    //  appending a new element to the body via body.appendChild
601
    //  by a script that is not a direct descendant of the <body>.
602
    document.body.insertBefore(iframe, document.body.firstChild);
603

    
604
    return iframe;
605
  }
606

    
607
  /*------------------- Local Assets --------------------*/
608
  /*------------------- CDN Assets --------------------*/
609

    
610
  /*------------------- fetch base --------------------*/
611
    using(twttr.bundles.base, function() {
612
      provide('>base_bundle_evaled');
613
    });
614

    
615
    using('>base_bundle_evaled', twttr.bundles.api, twttr.bundles.phoenix_plugins, twttr.bundles.phoenix, function() {
616
      provide('>allCodeLoaded');
617
    });
618

    
619
    using("");
620
  /*------------------- fetch bootstrap data --------------------*/
621
  (function() {
622
    
623
    var xhr;
624
    if(window.XMLHttpRequest) {
625
      xhr = new window.XMLHttpRequest();
626
    } else {
627
      try {
628
        xhr = new window.ActiveXObject("Microsoft.XMLHTTP");
629
      } catch(e) {
630
        //  Eep
631
      }
632
    }
633

    
634
    xhr.onreadystatechange = function() {
635
      if(xhr.readyState == 4) {
636
        if(xhr.responseText.charAt(0) === '{') {
637
          provide('>bootstrap_data', function(exports) {
638
            exports(JSON.parse(xhr.responseText));
639
          });
640
        } else {
641
          
642
          eval(xhr.responseText);
643
        }
644
      }
645
    };
646
    xhr.open('GET', '/account/bootstrap_data' + (window.location.search ? (window.location.search + '&') : '?') + 'r=' + Math.random(), true);
647
    xhr.send(null);
648
  })();
649

    
650
  using('>base_bundle_evaled', '>api_bundle_evaled', function() {
651
    twttr.anywhere.remote = {};
652

    
653
    provide('>api_ready', function(exports) {
654
      initAPI();
655
      exports({});
656
    });
657

    
658
    using('>request_cache_seeded', function() {
659
      initCurrentUser();
660
    });
661
  });
662

    
663
  using('>bootstrap_data', function(data) {
664
    twttr.payload = data.payload;
665
    provide('>payload');
666

    
667
    twttr.remoteIP = data.remoteIP;
668
    twttr.requestFullCity = data.requestFullCity;
669
    twttr.recentPlaces = data.recentPlaces;
670
    twttr.cdnBase = data.cdnBase;
671

    
672
    if(data.currentUser) {
673
      twttr.currentUserScreenName = data.currentUserScreenName;
674
    }
675

    
676
    if (data.frontSuggestedUsers) {
677
      twttr.frontSuggestedUsers = data.frontSuggestedUsers;
678
    }
679

    
680
    if(data.griffinConfig) {
681
      twttr.griffinConfig = data.griffinConfig;
682
      provide('>griffin_config');
683
    }
684

    
685
    if (data.isAdmin) {
686
      twttr.rights = data.adminRights
687
      twttr.isAdmin = true;
688
    }
689

    
690
    if (data.isNarrow) {
691
      twttr.isNarrow = true;
692
    }
693

    
694
    if(data.pageLocale) {
695
      twttr.pageLocale = data.pageLocale;
696
    }
697
    if(data.pageLocaleJS) {
698
      //  Need to load language data
699
      using(data.pageLocaleJS, function() {
700
        provide('>languageData');
701
      });
702
    } else {
703
      provide('>languageData');
704
    }
705
    // TODO: Remove - This is done in global actions now
706
    // if(data.pageLocaleClass) {
707
    //   using('>base_bundle_evaled', function() {
708
    //     $(function() {
709
    //       $(document.body).addClass(data.pageLocaleClass);
710
    //     });
711
    //   });
712
    // }
713
    if(data.languages) {
714
      twttr.languages = data.languages;
715
    }
716

    
717
    using('>defaultViews', function() {
718
      if(data.showWelcomeBanner) {
719
        (new twttr.views.WelcomeToPhoenixBanner()).render($('#banners'), 'append');
720
      }
721

    
722
      if (data.flashNotice) {
723
        $('#flash-message-storage').html(data.flashNotice).show();
724
      }
725
    });
726

    
727
    using('>decider', function() {
728
      twttr.decider._updateFeatures(data.deciderFeatures);
729
    });
730

    
731
    using('>ab_decider', function() {
732
      twttr.abdecider._updateExperiments(data.abBuckets);
733
    });
734

    
735
    using('>api_ready', function() {
736
      provide('>request_cache_seeded', function(exports) {
737
        var seedData = data.requestCacheSeedData;
738
        for (var i = 0, len = seedData.length; i < len; ++i) {
739
          var seedItem = seedData[i];
740
          twttr.API._requestCache.inject(seedItem.api_request_name, seedItem.options, seedItem.json, 1);
741
        }
742
        exports();
743
      });
744

    
745
      if(data.homeTimelineFetchSize) {
746
        twttr.API.homeTimelineFetchSize = data.homeTimelineFetchSize;
747
      }
748
    });
749
  });
750

    
751
  createIFrame(function() {
752
    var that = this;
753

    
754
    using('>base_bundle_evaled', '>api_bundle_evaled', function() {
755
      twttr.anywhere.remote.server = that;
756
      twttr.anywhere.api.util.RemoteRequest.flush();
757
    });
758
  });
759

    
760
});</script>
761
<script>WATCH.end('javascript_includes');</script>
762

    
763
<!--[if lte IE 6]>
764
<script src="http://a2.twimg.com/a/1303425044/javascripts/phxie6.bundle.js"></script>
765
<![endif]-->
766

    
767
  </body>
768
</html>
769

    
    (1-1/1)