# cab_social v0.2
# Social bookmarking plugin for Textpattern.
# Dejan Čabrilo
# http://www.anegdote.com/

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................

YTo5OntzOjQ6Im5hbWUiO3M6MTA6ImNhYl9zb2NpYWwiO3M6NzoidmVyc2lvbiI7czozOiIw
LjIiO3M6NjoiYXV0aG9yIjtzOjE0OiJEZWphbiDEjGFicmlsbyI7czoxMDoiYXV0aG9yX3Vy
aSI7czoyNDoiaHR0cDovL3d3dy5hbmVnZG90ZS5jb20vIjtzOjExOiJkZXNjcmlwdGlvbiI7
czo0MjoiU29jaWFsIGJvb2ttYXJraW5nIHBsdWdpbiBmb3IgVGV4dHBhdHRlcm4uIjtzOjQ6
InR5cGUiO2k6MDtzOjQ6ImhlbHAiO3M6MTI5OToiCmgxLiBjYWJfc29jaWFsIC0tIFNvY2lh
bCBib29rbWFya2luZyBwbHVnaW4gZm9yIHRleHRwYXR0ZXJuCgpoMi4gU3VwcG9ydGVkIHNp
dGVzCgpDdXJyZW50bHkgc3VwcG9ydGVkIGFyZTogZGVsLmljaW8udXMsIGRpZ2cuY29tLCBz
dHVtYmxldXBvbi5jb20sIGZhY2Vib29rLmNvbSwgcmVkZGl0LmNvbQpNb3JlIHdpbGwgY29t
ZSBpbiB0aGUgbmV4dCB2ZXJzaW9uIGFuZCBwZXIgcmVxdWVzdCAoeW91IGNhbiBmaW5kIG15
IGVtYWlsIGF0IGh0dHA6Ly93d3cuYW5lZ2RvdGUuY29tKS4KCmgyLiBJbnN0YWxsYXRpb24K
CiogSW5zdGFsbCBwbHVnaW4gcGVyIHVzdWFsLgoqIEFjdGl2YXRlIHBsdWdpbiBwZXIgdXN1
YWwuCiogVXBsb2FkIGljb25zIChmcm9tIGljb25zLnppcCkgdG8geW91ciB3ZWJzaXRlIChl
LmcuIGh0dHA6Ly91cmwvaW1hZ2VzL3NvY2lhbCkKCmgyLiBVc2FnZ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