Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

Thursday, June 14, 2018

Twitter Tracking, or why the EU Cookie Warnings are Retarded

After the EU overstepped its jurisdiction by mandating that all sites, not just European ones, place an obtrusive and annoying warning bar somewhere telling users that they use cookies and requiring it to be dismissed (or deleted via browser console, hidden via ad-blocker rule, etc.), it comes as no surprise that sites started using the other available methods of tracking to track their users against their consent.

Twitter uses a part of the JavaScript Web Storage API, called Local Storage, to do precisely this, even if you have all of the tracking preferences turned off.  You can look at it in your browser's developer console (usually opened by pressing F12, you may have to click a tab titled "Console" after that) quite easily by just typing localStorage and pressing Enter.  After quite a while of using Twitter and clicking on things like trends, random tweets, and whatnot, the page's Local Storage becomes a rather large object.  Twitter uses Local Storage for a lot of its functionality, but the tracking portion of it can grow to a truly massive size if not manually kept in check.

To more easily parse what they've got on you, you can run this code:
// re-enable the console window.console = (function(){ var a = document.createElement( 'iframe' ); a.style.display = 'none'; document.body.appendChild( a ); return Object.seal( a.contentWindow.console ); })(); // see what they've got on you Object.keys( localStorage ).filter( function( element ){ return element.startsWith( '__XHRNotes__' ); } ).forEach( function( current ){ console.log( 'localStorage["' + current + '"]: ' + localStorage[current] ); } );
Note that we have to re-enable the browser's console logging function, since Twitter helpfully disables it.  Twitter disables it repeatedly, so the code has to prevent it from being immediately re-disabled.  This is what Object.seal() does for us.

Once you've taken a look at the rather cryptic data they've got on you, you'll probably want to delete it, and that's easy enough, just run this:
// erase it all Object.keys( localStorage ).filter( function( element ){ return element.startsWith( '__XHRNotes__' ); } ).forEach( function( current ){ delete localStorage[current]; } );
Note that normally I would package this up into a nice user script, but doing so here requires a lot of work.  It needs to enable its user to see the data in a convenient manner, and allow them to clear individual pieces of it as well as nuking the whole thing from orbit.  This means inserting stuff into the page, and mimicking Twitter's page structure to make it look like the rest of the page, which is very time-consuming to implement.  It can be done, and I might even do it, but I really just wanted to get the barebones code out there.  In a pinch, you can paste the code from above that deletes the data into a user script that runs on every Twitter page load.  You may consider running it in an 'onstorage' event handler (PROTIP: window.addEventListener( 'storage', function(){/*code here*/} );), though, so that it happens any time Twitter updates its Local Storage, as opposed to only when you refresh the page.  Some entries that will be deleted by that code seem to be more benign than others, so you may run into issues.

Local Storage is basically the tracking company's wet dream: it does what cookies do (persist between sessions), but with no expiration date, and it's a lot less cumbersome to set up and manage.  The page's code is (in theory) the sole arbiter of how long stuff gets stored there.  Just like with cookies, though, the user can clear it at any time, but sites rely on it being reasonably obscure and hidden, since it's not talked about nearly as often as cookies are.  Also, just like with cookies, there are just as many good uses as there are nefarious ones.  Local Storage has a little brother called Session Storage, that gets cleared when you close your browser.  Twitter uses Session Storage as well, but the data stored there is comparatively boring.  Any good ad blocker and script blocker combination will prevent things from happening based on Twitter's usage of Session Storage.

Tuesday, October 18, 2016

Oh Hi There

So, Twitter's had these things called Twitter Cards for a while now.  You've probably already seen them in action.  When you post a link to a website, there will be a box with information about the link as opposed to just a plain link.  That's the Twitter Card, and it's dead simple to implement.

It's all in your page's <meta /> tags.  I'm not going to go in-depth describing how to do it here, because Twitter's got a whole section of their developer site for that.  There's a bit of finagling to get it working on Blogger since you have to edit your template, and if you want to customize them at all you'll end up having to learn Blogger's template language.  Thankfully, it's XML-based, so it's not completely terrible.

Blogger's template language isn't without its shortcomings, though.  The vast majority of the data you might want to work with is only available to specific page widgets.  For instance, on the Twitter Card for my blog's archive pages (click a year or month header in the archive section to get one such page), I wanted the title to just be my blog title, and the description to say something like "Post archive for $MONTH $YEAR".  While there's a way to get the date of the archive, it's only available within the archive widget itself, and not available to the whole page, even when the page is an archive page.  I had to settle for leaving the archive's date in the title and just putting "Post Archive" in the description.

Also, their template language completely barfs all over the place if you have the nerve to try and prepend a string to a data variable.  Appending works beautifully, but prepending causes the whole thing to fail.

Now, in any other language, I'd just go "oh, well, the page title contains the archive's date, I can just test for page type, and if it's an archive page, use string functions to pull the archive's date out of the title and stick it in the description instead!", but we don't get anything nearly as fancy as that here.  I'm basically stuck with what I've got until their template system gets more powerful.

Theoretically I could submit feedback about this, but the trouble with that is, this is Google we're dealing with.  I'm not going to get a response.  In all reality, I'll be completely ignored.  They're not going to implement some random suggestion that one guy would find useful; they'll only implement what they come up with because then it's "cool".

Anyway, when I link my new posts on Twitter, they'll now have Twitter Cards instead of just being plain links.  This change doesn't seem to apply retroactively, so don't go looking through my old tweets for it.

Monday, April 9, 2012

Janetter

With TweetDeck having been acquired by Twitter and the subsequent removal of useful features including but not limited to TweetDeck's long update service, deck.ly, that let you post updates that were longer than 140 characters, I've been thinking about switching Twitter clients.  I moved to TweetDeck originally because the very first New Twitter was absolutely horrible and the redesigns that have followed haven't improved it at all.

A few friends of mine are using Janetter, so I downloaded it and tried it out for a bit.

It's got a simple interface similar to TweetDeck and lets you easily follow conversations between people.  TweetDeck has that feature but it's glitchy and sometimes only shows one tweet from one of the people.

Also, it has something that intrigued me.  Its themes are done entirely with HTML, CSS, and JavaScript.  This came into play straight away because I browsed through the themes and discovered that what I really wanted would essentially require me to combine aspects of a few of them together.  I most definitely have that capability, but it suffers from a complete and total lack of documentation.  I can't just make a new folder in the directory where the themes are stored, copy data from another theme there, modify to my liking, and have my results show up in the theme list automagically.  There is a button you can click to add a new theme, but it prompts for its own special format, which may possibly just be a renamed ZIP archive, but once again, there's no documentation.

Playing around with it I noticed it's got some horrible custom window border bullshit by default, but when changing themes you can check a checkbox that says "Use the default Windows visual style".  And you have to do so every time you change your theme, because the box helpfully unchecks itself.

I was a bit disappointed that it doesn't seem to have the ability to disable automatic updates.  I don't really want anything I have installed automatically updating any portion of itself.  This even goes for Steam and games released upon it, but there even if you disable it you'll find the automatic updates mysteriously re-enabled if you go back in some time later.  I would much prefer a simple notification of an update and a yes/no choice for installing said update.

Feature-wise, it's missing a few things I use in TweetDeck, like the ability to see tweets from people you're following that are replies to people you aren't following.  You can actually see those tweets, but it's buried on a dialog box.  Also missing is a UI column that shows you who's following you.  Once again, it's buried on a dialog box.  And even within that, you can't use Twitter's "Block and report spam" feature.

So, whatever, it's a Twitter client, and the main functionality works.  I kind of went about my business and ignored it for a while, while I did other things.

Then I decided I wanted to play around with it some more, only to discover I couldn't find it on my taskbar.

Double-clicking on its tray icon brings it back up.  I went into the options and verified that "Show in taskbar when minimized" was checked, but it still minimizes to the system tray instead.  I then thought "well, maybe I need to restart it for that change to take effect", so I closed it.  Or so I thought.  The close button also just minimizes to the system tray.  Instead of, you know, actually closing the program.  To close it, you have to right click on the system tray icon and select "Quit".  Which is retarded.

I absolutely hate "minimize to system tray" as a general principle.  I want my shit to be right there on the taskbar where I can find it.  I hide all my system tray icons so that there's more space for the taskbar entries.  I really don't want to have to go into the system tray on a regular basis.

After noticing several updates from people I was following in TweetDeck and having Janetter not notify me about them, I inspected the notification options and noticed that the one notification feature anyone would ever want over any other possible notification feature, being notified of new tweets from the people you're following, is disabled by default.  A lot of sense that makes.

The verdict: I guess I'll just stick with TweetDeck, until the Adobe Air version stops working.  After that, I don't know what I'll do.

Wednesday, October 26, 2011

lol

So, I've been playing around with the Twitter feed in the sidebar over there.  I think I'm done now.

I had briefly updated the Blogger-approved Twitter widget to its most recent version, but it had that annoying "add this to your blog" image at the bottom that I couldn't get rid of and had tooltip text in some other language.

I don't know why I didn't know about this sooner, but Twitter has an official widget thing.  Which is what you see now.  I guess it's because of the fact that since I use TweetDeck, I don't regularly visit twitter.com anymore.

I sincerely hope that this one will show retweets...

Also, just because I am who I am, I grabbed a copy of the widget Javascript that the widget remotely loads from Twitter's server, and put it up on my site, where it won't ever change except when I want it to.  So there won't be any unexpected "congratulations, this thing now looks and/or operates different(ly) and you have no option of going back to how it used to be" bullshit.

Tuesday, January 18, 2011

MAGFest 9

This is the end-result of me omitting most of the 119 tweets I posted during MAGFest, summarized and expanded upon in case you'd rather read a blog post instead of 119 tweets that will only become more and more buried in my Twitter history.

Jump break here to keep the main blog page uncluttered.

Tuesday, September 7, 2010

Twitter's New Link Shortening Service

Twitter sent out an email a few days ago detailing their new link shortening service, using the URL http://t.co/.  Reading through it, I thought it was nice at first, but after finishing reading the email, I have some concerns.
  • First off, its use will be automatic and therefore mandatory.  Will this be the case even if you've already used another link shortening service to shorten the link, as I do with bit.ly?
  • Second, are they trying to destroy all other link shortening services?  The number one reason there's so many of them is Twitter's retardedly low character limit.
  • Third, the only thing I really like is the preview feature, which is something all other link shortening services lack, save for TinyURL, which is ironic because it produces long links in the spectrum of shortened links.  Bit.ly has a Firefox extension that adds previews to other shortened links, but it has security issues.  Since it remotely loads a CSS file from their servers on every site you visit, bit.ly gets a nice list of every single site you visit, whether it has any shortened links or not.  They claim to not store this information, but I don't believe them any more than I believe Facebook when they say beacon data isn't stored for users that turn it off.  Those beacons still get sent, the setting only "controls" whether or not Facebook ignores the data.  It's probably a placebo switch, given the appearance of doing something while in reality not doing anything.
  • Fourth, and possibly most important: Twitter stated that link clicks will be logged "to provide better and more relevant content to you over time."  To me, this means data mining for the express purpose of tracking their users' activity for marketing and advertising.  No thanks, I don't want to be tracked or advertised to.
  • Last but not least, how exactly will the automatic shortening work?  Will it happen as I paste the link into the tweet, or after I hit the Tweet button?  This pertains mostly to the remaining character count.  Will it be accurate and shorten the link on paste, or will it be inaccurate and force me to stare at a negative number, unsure how long my tweet will actually be with the link shortened?
Link shortening integrated with Twitter would be a very nice thing to have, but it really should be optional.  Furthermore, if they made changes to the way they process and store tweets, the length of a URL wouldn't matter.  URLs have some required formatting, beginning with the protocol designation, and needing spaces to be encoded in order to contain them, so therefore a simple regular expression can find any link and exclude it from the character count.  They could then selectively shorten the link depending on a user preference or for mobile browsers.

Kind of unrelated, but it makes about as much sense so I just have to rant about it: Why do people think it will actually work when they try to retweet a message with their own commentary added?  It doesn't.  It doesn't register as a retweet.  In order for it to do so, the retweeted message must be identical, just with RT @username in front.

Wednesday, July 28, 2010

Crucial Twitter Shortcoming

I'd noticed this in the past, but it actually mattered this time because someone (see comments on previous post) was trying to contact me.

Twitter won't show you @mentions on your Home page from people you aren't following.  Normally this is because someone you aren't following could be having an @mention conversation with someone you are, and thus it keeps the page uncluttered.  But when someone who isn't following you @mentions you...  You have to open the @mention page to see it.

Also compounding this issue is the fact that Twitter doesn't show you how many unread @mentions you have.

Long story short, even though I'm not the guy the commenter on the post below was looking for, I'm helping with the issue.