Archive for November 6th, 2008

Too wide social network

Yesterday I asked Catman if it was him to give away my MSN contact because lately I’m added by people I don’ even know and I ended up telling him the method I use to get rid of contacts I don’t need. Next, I adapted it for you as an algorithm in Delphi code. Feel free to use the result of a programmer’s boredom.

procedure CleanContacts(Username: String; Password: String);
var
  i: Integer;
  Save: Boolean;
  Contacts: TMSNContactsList;
Begin
  Contacts.LoadFromAccount(Username, Password);
  For i := 0 to Contacts.Count - 1 do
  Begin
    Save := Contacts.items[i].Friend Or
      ((Contacts.items[i].ContactSex = csFemale) And
      (Contacts.items[i].SizeBust > 70) And
      (Contacts.items[i].SizeWaist < 80) And
      ((Contacts.items[i].SizeHip < 100) Or
      (Contacts.items[i].SizeHip > 70)));
    If Not Save then
    Begin
      Contacts.Block(i);
      Contacts.Delete(i);
      i := i - 1;
    End;
  End;
End;