Postman (REST Client) Tests

Published 2014-10-31, 16:04

### VORBEREITUNG ###

// save response in env
var data = responseBody;
postman.setEnvironmentVariable("data", data);

// parse value from json and save in env
var data = JSON.parse(responseBody);
postman.setEnvironmentVariable("device_id", data.id);

// parse array from json and safe as string and save in env
var data = JSON.parse(responseBody);
var product = JSON.stringify(data[0]);
postman.setEnvironmentVariable("contentful", product);

// parse array from json, change value, and safe as string and save in env
var data = JSON.parse(responseBody);
data.locale = "en_US";
var device_update = JSON.stringify(data);
postman.setEnvironmentVariable("device_update", device_update);


### TESTS ###

// test resposonse code
tests["Status code is 200"] = responseCode.code === 200;

// test if response is empty
var data = JSON.parse(responseBody);
tests["Transaction list is empty"] = data.length === 0;

// test if body contains value
tests["Body contains string" + environment.device_id] = responseBody.has(environment.device_id);

// test exact values of json
var data = JSON.parse(responseBody);
tests["transaction.id is " + environment.transaction_id] = data.id === environment.transaction_id;
tests["transaction.state is IN_PROGRESS"] = data.state === "IN_PROGRESS";

Managing Twitter Lists

Published 2013-11-09, 22:37

I started to group my „twitter users I follow“ (Why is there no better word?) in (public and private) thematic lists to be able to follow them seperately. List management in Twitter’s web and mobile apps lacks a lot of features, so I went to trusted Google to find what is out there. Here are my 3 recommentations:

With these tools I was able to move some people around and dramatically clean up my lists.

Now to find (or create) a Twitter client that is made for lists and this style of reading. (On Windows, I recommend Tweetdeck.)

How to use private and business Dropbox accounts on Windows (7) at the same time?

Published 2013-11-04, 22:17

There seem to be two working options:

  1. http://nionsoftware.com/dbpahk/instructions
    This one got a nice installer and you can choose a colored icon so you can actually recognize your private/business Dropbox systray icon.
    But it uses an older Dropbox installer.
  2. http://semi-legitimate.com/blog/item/multiple-dropbox-instances-on-windows-7
    Here you need to create a second user account so Dropbox can save its configuration somewhere. Nice hack, but very hacky.

I’m testing (1) right now and for now it seems to work great. Hope it keeps working.

How to connect to Campfire using your favorite IRC client

Published 2013-10-12, 17:08

The team of a new project uses Campfire for group chat. Campfire is 37signal’s web based chat solution from back when they launched a new product every few months.

I don’t like chatting in a browser. And I’m a Windows guy and all the native Campfire clients for Windows work, but are not very pretty. You could probably even say they are a bit ugly. That’s why I went on a hunt to get Campfire into a Jabber or IRC client.

I’m in IRC all the time on freenode for several development channels, so I was really happy to find a small script that builds a brigdge between the Campfire API and IRC: https://github.com/zerowidth/camper_van

Here is a small ‘how to’ on how to get it to work on Windows:

  1. Download Ruby Installer: http://rubyinstaller.org/downloads (I would suggest using the 1.9.3 version.)
  2. Use these options for the installation:
  3. Download the matching Development Kit from the same site.
    The installer is a bit crappy, make sure to extract to a new folder on your HD (e.g. “C:/Ruby Devkit”).
    Run the following commands in a command prompt in this directory:
    ruby dk.rb init
    ruby dk.rb install
  4. Now you can install the camper_van Ruby gem:gem install camper_van(Will take a while)
  5. Run camper_van to start the Campfire-IRC-bridge

Now you can connect to 127.0.0.1 on port 6667 using “##campfire_subdomain##:##your_api_key##” (You can find both on your member site of the Campfire chat room) in your favorite IRC client. After connecting, /join #channelname to join your channel and you’re done.

camper_van translates all nicknames from “Foo Bar” to “foo_bar” so you can use it to reply to people in chat and your client can inform you if you were mentioned. Same for images or tweets, should all work.

Firefox Tab Groups – Making Firefox even more useful

Published 2013-09-27, 14:00

Somewhere between Firefox 3 and the current Firefox 23 Mozilla decided to add the concept of „tab groups“ to the browser. I don’t know exactly when, because I didn’t notice it. But it absolutely changed how I use Firefox.

Before, most of the time I had 2+ Firefox windows open to seperate different tabs depending on the content, task or context. I listen to music most of the time, very often in web based sites like Soundcloud or Mixcloud, for example. A second window had become my queueing system for the music I wanted to listen to next.

Tab groups offer a better solution to that problem:

Now I just have a second tab group open all the time where I put the music related tabs. I pin the currently playing tab, so I can also access it from my normal work tab to be able to be able to stop and resume the music. When a song is finished, I close the pinned tab, switch to the other tab group and select my next track, start and pin it, and continue working. Without ever leaving the current Firefox window.

It’s not perfect. But that’s what add-ons are here for:

With these two I can change between tab groups with one click (before, you had to go to a tab grou overview and then select the tab group), and open links and bookmarks directly in any of the open tab groups.

My Google Reader replacement

Published 2013-09-26, 14:48

After Google closed their RSS reader I of course was looking for a web based replacement for it. Wanting more a  „river of news“ than Pinterest or „Let us decide what you want to read“, the search actually got quite complicated – many of the new reader replacements popping up didn’t match my requirements, and even if they looked like they did, most of the time they were broken or not really thought through.

A more structured list of my requirements:

I used ReplaceReader, Russel Beattie’s Readerpocalypse-the-Players-article, this epic list and some Google searches to find the following list of replacements:

Feedly, free

Very feature complete. Sometimes strange UX, quite often doesn’t really save read progress. But has an API that is supported by the biggest iOS readers.

TheOldReader, free

Matches the old Google Reader very closely. Didn’t scale well in the first days after the shutdown, actually seems to closely related to Google Reader to innovate.

Aol Reader, free

Big company, good designers. Makes a great rss reader with a perfect design. Shame they needed sooooo looooong to offer users to reorganize their imported feeds. Small feature, big frustration if it’s missing.

Digg Reader, free

See what I wrote about Aol Reader.

Newsblur, limited free, $2/month, $24/year

Oldie but a goodie. Works great, but I don’t like parts of the interface.

Feedbin, $3/month, $30/year

Ben Ubois created one of the newer Google Reader alternatives, and he did a pretty good job. I really like the general style of the product, but really dislike the user of tags instead of folders and the missing ‚complete articles river‘ view.

Yoleo, free (or $9/year donation)

„the beautiful reader“ is it’s tagline, and Jamie Gilgen did a really good job at that. Unfortunately, she also made some very strange decisions and the river of articles, or „waterfall“ as she calls it, is still missing.

Curata Reader, free

„The Cleanest Reader“. Yup, but also missing lots of the functionality I want.

Feedspot, free, $3/month, $24/year

Again, most of the stuff of Google Reader (and more) works and looks pretty decent.

Commafeed, free

„Bloat-free feed reader“. Support the most important stuff, but is also quite slow.

Hive, free

„Content first, no distractions“

Bloglovin, free

Works, pretty, but also not flexible enough. Very Pinterest/fashion oriented.

kouio, free

Prettyyyyyy. But no river view and not really made for lots of folders.

Others

More great readers, but didn’t really bring anything new to the table beside variations in design and which features were or were not supported:

Tiny Tiny RSS

Because it actually looks good I also decided to include this self hosted reader.

So which one did I choose? Feedly. It just worked when all the others had scaling problems and it supports all the features I need. It’s not perfect, but now I’m used to it.

Wikipedia Mobile #1

Published 2012-04-08, 02:00

This morning I accidentally installed Wikipedia’s mobile app on my iPad. It felt sluggish, strange and not at all what I expected. As bitching doesn’t help and I wanted to use my professional knowledge in my free time, I started poking around. This is the result.

Starting position

The iOS Wikipedia app has really bad ratings. Users complain about bad performance, bad usability and about the feeling that this is more an Android app but an iOS app. In sum, this creates you a rating of only 2 stars for the current version. Ouch.

Android users seem to be happier with their 4.5 star rating. The problems only exists with the iOS version of the (similar) app. Strange. Let’s start with the basics and look into the feature set:

Doesn’t sound too bad. It’s not only stuff a mobile web site could do, so an app makes sense. So lets start to investigate.

What’s the background of all that?

The AppStore description of the app also links to a Twitter account and the source code of the app on Github:

From these two links I basically spent hours reading, clicking, reading again – typical procrastination stuff (Procrastinators beware if you are even near Wikipedia articles…). But I learned a lot 😉 Back to topic: The following links all are relevant to the mobile efforts of Wikipedia:

While reading these pages, I noticed information about two different iOS apps: One is based on Rhodes, one on Phonegap. It turns out the Phonegap version for iOS is quite new and the old one is to be retired and phased out:

So we have several projects and initiatives in the mobile space of Wikipedia:

Not too bad. Of course the articles in the wiki are quite… organically grown and sometimes hard to differentiate and classify. But I think that’s the case most of the time when volunteers and professionals work together.

The funny stuff: code

Now I have an overview, so let’s get back to the funny stuff: code.

As I have never used git before, I spend some time installing all the tools and learning how to use them. After that I can finally checkout the repository on Github. While I do this, I notice that the README.md isn’t as pretty as all the readmes of the other Github projects I know. So that’s the first thing I decide to fix. 1 hours, lots of reading and 3 minutes of ‚coding‘ and a pull request later, it is done. My commit gets integrated by reedy a few minutes later. I’m in.

But now to the real code. The folder structure of the repository isn’t very clear. There are lot’s of confusing files in the root that don’t really belong there in a multi platform project, several folders that also don’t make sense to me or I can’t identify. Again, this seems to have grown over time. This is definitely something that could and should be fixed.

In /assets/www I find something that looks like the html application. Loooots of Javascript, jQuery and Zepto *confused. Anyway, using –disable-web-security I can open the Phonegap app in Chrome and even get it working! Still, several ‚file not found‘ as non-existant files are requested. But here it becomes quite clear, that the app itself is no bad in itself. It works, the code is more or less structured, you can see what the developer was thinking. Normally that’s a good thing. So as to not fish around without all information, I conclude my little poking session for today.

Conclusion

After getting this short glimpse into Wikipedia Mobile I think that the code isn’t the first problem to fix. First it needs some love in the Documentation and Organization of the code. So that’s where I will start. Let’s see what I can do.

PS: Well, I installed the app on my old iPod 3 (iOS 4.2.1) and tried to use it – completely unuseable. Maybe we should start with the code after all.

iPhone-Apps analysieren

Published 2012-04-06, 22:55

Heute habe ich ein paar iPhone-Apps auseinander genommen und sowohl Funktionsweise als auch Datenverkehr näher angeschaut.

Grundlagen

http://www.uptill3.com/static/iphone_forensics.pdf

Dateien auslesen

http://www.macroplant.com/iexplorer/

(Binary) Plist Dateien anzeigen

http://www.icopybot.com/plist-editor.htm

Cookies.binarycookies

http://it.toolbox.com/blogs/locutus/understanding-the-safari-cookiesbinarycookies-file-format-49980

SQLite Datenbanken anschauen

https://addons.mozilla.org/de/firefox/addon/sqlite-manager/

Web-Traffic nachvollziehen

  1. http://www.charlesproxy.com/
  2. iPhone und Rechner in selbes WLAN
  3. Rechner-IP:8888 als Proxy der WLAN-Verbindung im iPhone einrichten
  4. Session capturen

SSL-Web-Traffic nachvollziehen

  1. Proxy -> Proxy Settings -> SSL -> Enable SSL Proxying
  2. Locations mit den entsprechenden Domaisn füllen
  3. Help -> Install Charles CA SSL Certificate -> Details -> In Datei kopieren -> Per Mail an iPhone senden und installieren

Vorsicht, besser nicht zu sehr bei der Installation von Apps benutzen, ich war heute 2 Stunden vom AppStore ausgeschlossen 😉

Mit dem Setup kommt man schon recht weit und kann doch so einiges lernen.

Wireshark: Copy content of compressed requests

Published 2012-03-07, 17:40

Copying the content of a request compressed by using gzip is not easy in Wireshark:

  1. Click the request you want the content from
  2. In the Middle panel, click „Packet Details“
  3. Collapse all branches
  4. Right click on last Branch (Could be „Line-based text data: text/html“ or „Media Type“)
  5. Click „Copy“
  6. Click „Bytes (Printable Text Only)“

Now you have the content in your clipboard and paste it where you want.

Fix ugly fonts in Firefox 5

Published 2011-06-27, 09:40

  1. about:config
  2. gfx.direct2d.disabled auf true setzen

21 queries. 0,121 seconds.