Video based on "Flesh paths" by Alessandro Amaducci
Remixed by Steffest
Mute Audio - Pause video - Clear screen
Steffest Digitale Pulptuur
Je bekijkt alle berichten met de tag: "Scripting".
Bekijk terug alle berichten.

a picture called telenetdigicorderAPI.jpg (click to enlarge)

A few months ago, Telenet finally made the jump and opened up their digicorder devices to be controlled through their TV web portal TV.be.

Nice!!!
Finally you could schedule your TV recordings from anywhere using a web browser instead of a infrared remote and the dorky digicorder interface.

Controlling media devices through web interfaces happens to be one of my sweet spots so the first thing I did was firing up Firebug to see what kind of communication was going on between their various web applications.
They've done a really good job, as they created an internal API to talk to the digicorder.
Figuring out how the API works has the same attraction as seeing a crossword puzzle in a newspaper: it tickles your mind but at the same time it's not too hard and with some time and logic the puzzle is quickly solved.

So, let's get to work to create a more open API to control your TV recordings from any software package you want instead of only through the tv.be website.

First step: login
Telenet uses a single-sign-on system, providing a token that authorises you as "logged in" and that you can take with you to other sites.

It sends you on a redirect path towards multiple domains - telling each domain you have logged in.
The script just recreates that path and makes sure to collect and pass all cookies to the next step. (That's really easy in .net - just use the same cookiecontainer for each request)
After that you can use the Telenet remotePVR API from the script as an authenticated user.
One problem though: to schedule a new recording you need the eventID of the program you want to record.
That's where tv.be and some good old screenscraping comes in: a Channel listing for each day is requested on the tv.be website and the EventID codes get extracted and saved to a local cache (so we don't have to hammer the tv.be site more then we need to)
Technically that might be against Telenet's Terms of Use policy, but hey - we're all in favour of free and open data, aren't we?
That's it.
I created a more simple API as .net wrapper class with the following syntax

Dim tvbe as new tvbe
tvbe.login()
tvbe.logout()
tvbe.recordings()
tvbe.reminders()
tvbe.zenders()

In a webapp that translates to URLs as

/login
/logout
/boxes 'gets info on your digiboxes and digicorders
/recordings
'gets a list of your scheduled and completed recordings
/recordings/schedule/ID
' schedules a new recording, ID is an eventID provided by tv.be
/recordings/delete/ID
' deletes a recording, ID is an eventID provided by tvbe/recordings
/reminders/ 'gets a list of your scheduled reminders
/reminders/schedule/ID ' sets a new reminder, ID is an eventID provided by tv.be
/reminders/delete/ID
' deletes a reminder, ID is an eventID provided by tvbe/reminders
/zenders ' (short)list of available channels
/zenders/channelname ' program guide of the channel with name "channelname"
/zenders/channelname?date=dd-mm-yyyy ' program guide of the channel with name "channelname" of a given day 


The sourcecode can be found here.

Update:

After a (very friendly) request from Telenet I'm taking the sourcecode and the demo application offline.
However I do hope I can contribute following their open invitation to help unlock their digital services towards a more open communication (API?) in general and mobile devices in particular.
To be continued ...


As a demo I created a little frontend for the API for use on mobile devices.

http://tv.stef.be it is.

You can use the TV guide without login in, but if you want to manage your recorders you have to create an account at tv.be (and be a Telenet Digital TV customer of course) 
It's a bit of a trust-issue to enter your telenet credentials in a "rogue" app like this, but i can assure you it's safe: your credentials are not stored anywhere and are only used to pass through the Telenet login sequence.
If you're still hesitating to enter your login, you can grab the source and try it on your own machine.

Here are some screenshots.
image image image foto

 


The API still has some holes, mostly because not all tv.be content is easily available.
Most important i would love a simple system to convert EventID's to program names and vica versa, maybe if i ask the tv.be people nicely? :-)
Also it's not really suited if you have more then one digicorder.
A search function would be nice ... maybe I'll implement that.

Of course it works fine as long as Telenet doesn't change their internal API, which is always a risk, but well,  then the cat and mouse game can continue.
I was planning to build an Android app for it but actually http://tv.stef.be works very well on mobile devices and since you still would need a data connection to talk to your digicorder, why would you create a native app when a webapp will do?

Happy recording!

"Usenet indexer Newzbin has lost its MPA court case."
Maybe that doesn't ring a bell but anyone who's been digging into to "downloading stuff from the net" will soon find out that Usenet is the place where it's at: your one stop shop for all the movies, TV shows, music and apps you can chew.
The only problem: it's too much and as is the case with the torrent trackers - Usenet is also flooded with crap: virus infested apps, password protected files, DRM loaded pay-movies,... 
Not very easy to find the good stuff.

That's where Newzbin came in: their system of user-generated and verified reports made it a no-brainer to find clean and high quality releases - nicely packaged in so called nzb files,which are a list of all the binary chunks you need to download from a Usenet server in order to rebuild the files you want.
AND they have a very nice API for developers like me so they can script and automate their download flow.
Not anymore: starting from March 31, no new reports are being added. The service is not broken, but without updates it's pretty darn useless.
So there i was: sitting in my bathtub, sipping my red wine and hitting the play button, only to find the latest episode of Lost wasn't there.
No fun!
Especially since I was not in the position to jump up, run to the keyboard and quickly find another source.

As these things go, it's a classic case of  "the King is dead, long live the King".
NZB sites are not hard to find and I quickly updated my scripts to use NZBMAtrix as an alternate source.

One of those scripts is a mobile optimised search tool to quickly find a TV-show (or whatever it is you're looking for) and tell your homePC to download it.
The idea is that you use your mobile phone to initiate a download, your homePC downloads the file using a fast internet connection and streams it back to your mobile phone. Very easy and very fast: e.g. downloading a TV episode takes a minute or 2 after which you can use Relocally - or something like Air Video - to stream it to your device.

The script is called Usenet-o-matic.  It will be part of Relocally, but if you want you can use it yourself.

It's available  at http://usenetomatic.codeplex.com.
In this first release it supports Newzbin and NZBmatrix as index sources and SABnzbd as download server.

This means that in order to get it working, you need a Newzbin premium account or a NZBmatrix VIP account and a SABnzbd installation. (and a decent Usenet provider obviously - like Giganews)
I admit: those are a lot of things to set up (and are not free) so probably the target group of a script like this is pretty narrow, but once you get everything inline, download Walhalla is yours :-)

Sorry, no live demo but here are some screenshots: (Yeah yeah, I know: it looks like crap, I left the design part for you to add :-) )

image  image  imageimage

Vorig weekend ging ik nog eens een wandelingetje maken, als voorbereiding op deze tocht, weet u wel.
40 km stond er op de planning. Het was tevens de eerste grote test voor mijn real time google maps/latitude/twitter/blog mashup (een hele mond vol, maar het gaat dus over de kaart die u hieronder zit)
- voor de RSS lezers die de iframe-kaart niet zullen zien: het is deze.

Ik ben al een tijdje bezig mijn mijn locatie te loggen. Ik gebruik daarvoor voornamelijk Google Latitude: mijn telefoon weet waar ik ben en geeft dit door aan Latitude. Door om de zoveel tijd deze locatie op te vragen en op te slaan in een database krijg je zo een geo-log waar je overal bent geweest. Het handige is dan dat je van alles waarvan je weet WANNEER je dit deed, je ook ineens weet WAAR dat gebeurde.
Als je bijvoorbeeld een tweet stuurt, of een foto maakt en upload, dan kun je ineens op een kaart tonen waar je was.
Dit doe je dan van tijdstip A (je vertrek) tot tijdstip B (je aankomst) en voila! je hebt een routekaart van je tocht met geografisch aangeduid waar (en wanneer) je bv een foto postte of iets op twitter zei. (je kunt op de icoontjes klikken om de tweet/foto te zien)

Het mooie is dat dit dus realtime gebeurd (of kan gebeuren).
Als backup heb ik ook een GPS-logger bij, om achteraf de locaties wat bij te schaven en dat is eigenlijk wel nodig ook.
Google latitude is eigenlijk niet bedoeld om je route te tracken, maar om je huidige locatie te tonen.
Het maakt af en toe rare locatie-sprongen want zelfs als de gps van je telefoon continu aan staat, stuurt latitude soms toch de geïnterpoleerde gsm-mast locatie door en die is veel minder accuraat.
Op je route lijkt het dan soms alsof je heen en weer springt.
Ook ergerlijk is dat er geen mogelijk is om exact te bepalen wanneer Latitude de nieuwe locatie doorstuurt en ik heb al gemerkt dat dit best lang kan duren.
Langs de andere kant is het wel een erg mooie applicatie die bovendien ook erg vriendelijk is voor de batterij van je telefoon - niet te onderschatten tijdens lange tochten.
De "real-time" kaart is dus niet zo accuraat, pas bij terugkomst wordt de route 100% juist na het importeren van de GPS-logger gegevens.

Tijdens de tocht bleek alweer dat "social media" als twitter effectief wel "social" is: ik was in mijn enthousiasme vertrokken zonder geld of drinken - dom natuurlijk, en dat had ik meteen maar op twitter gezet.
Gelukkige was er een vriendelijke twitteraar die zeer juist deduceerde dat ik wel eens in zijn buurt kwam te passeren en bood aan dat ik bij hem wel mocht komen lunchen - WAUW! - nogmaals een dikke merci! (jajajaja twitter is ECHT cool)
Je ziet op de kaart dat ik op een gegeven moment rechtsomkeerts maak om nog even langst Broechem te passeren - waardoor de tocht uiteindelijk 45 km lang werd.
Ik moet zeggen dat ik blij was dat ik de finish bereikte - het viel eigenlijk wat tegen en ik voelde me echt een oude zak.
Dat beloofd ...
Dit weekend staat er weer een 45-km tocht op de planning - dit keer in groep, wat meestel iets minder snel vooruitgaat.
Uiteraard wordt deze ook getrackt!

(De kaart is even verhuist naar http://blog.stef.be/location/route.asp?duffel )
a picture called mobipodcatcher.jpg (click to enlarge)

As the tv-season is on hold during the summer months, I had to switch to another type of "media" to consume during longish train/bus rides, so I picked up some podcasts again I like to listen to.
These days mobile devices are also more and more "connected" to the web and downloading music and/or podcasts to your mobile device seems so tiresomely old ... so: streaming audio for the win !
There are several really good streaming audio clients on the various mobile platforms, but heck, I found it was really frustrating to get the updates from your favourite podcast and get your device to play the darn thing.
Most annoying, especially as it was not a technical issue but an "ease of use" and "interface" issue.
Conduits Pocketplayer does a semi-decent job, but that thing is bloated and painfully slow to load as it tries to rescan your local music library AND your feeds at every move you make. (besides that, it's not free)

As always, the "If you want it done better, do it yourself!" mantra made me tinker to create a very simple and fast way to reach my favourite podcasts. no need to reinvent the weel and create a player; a small web application would do to fetch the latest mp3 url's and feed it to a player.

tadaaa!:  http://m.stef.be/pod (works in every browser but it's optimised for your mobile device)

Keeping track of various RSS feeds yourself in any application is a bit a pain in the behind: you have to scan, validate and cache each feed at regular intervals which can quickly cause some major strain on your server.
This time i took the smarter route and created a connection to a system that does RSS aggregation better then anyone else in the world: Google Reader.

in Google Reader I label the podcasts i want with a tag "mobilepodcast" , then my podcatcher script simply fetches the 20 latest items of all feeds with that label.
I'll post the code for the Google Reader connection later, it's really an easy way to get a feed and you still get to process them the way you want.

Depending on your mobile device and the software your prefer, the application presents the audio files as a PLS playlist, a ASX playlist or a direct link to the mp3 file.
You can modify this by clicking the "settings" button to choose your preference.
On my mobile, I've setup Coreplayer to open .pls files automatically. It's hands down the best media player for windows mobile.

Future improvements might be to connect this with my mp3 library at home, allowing for streaming audio from the home pc, or with this collection, but we'll see about that ...
In the mean time: http://m.stef.be/pod it is.

 


My first submission to the inca-award contest is about ready.
Old scool gameplay for the win!

Woo the jury and collect als much good ideas as you can.
Show your clever tricks by solving the puzzles.

Create your own levels using the online leveleditor, So if you ever wanted to create a game starring Bnox, Dries Buytaert, Robin Wauters, Bart Becks or Luc Tayart, here's your change.
More info at http://www.stef.be/projects/inca

Vorig weekend opende Imke Dielen de "Most cute Male Geek" verkiezing.
Eigenlijk wilde ik dat alles gewon negeren, want - en ik mag dat zeggen he Imke - ik vond het vooral wat aandachttrekkerij, tot ik vrijdagavond zag dat @wolfr 9000+ stemmen achter zijn naam had staan.
Onder het motto "Allaai gast, alsge trisht, doegedan injees goe" oftewel "Wasdana, nen antwaarpenaar kan toch beter trishen dan die Netlash-gasten zekers" heb ik vrijdag dan toch eens een scriptje gemaakt om een mede-antwerpenaar van wat stemmen te voorzien. (Vooral ook omdat imke zelf zeer uitnodigend was)
Hier een kleine handleiding:

Stap 1 bij elke webapplicatie is altijd dezelfde: rechts klikken en "view source" kiezen.
Daar lezen we <noscript> <a href="http://answers.polldaddy.com/poll/1357963/">View Poll</a></noscript>
Wat de url is van de quiz op polldaddy.
Het meeste interessante op die pagina is de "vote" knop, die stuurt immers de actie door naar de webserver.

de actie is javascript:vote(1357963,0,0,1,10);
OK, dan even kijken waar die javascript staat.
in de HTML code staat <script type="text/javascript" language="javascript" src="/js/common.js?x=35"> <script src="js/common.js?x=35" type="text/javascript">
dus de url waar de javascript code staat is http://answers.polldaddy.com/js/common.js?x=35

daarin staat (in versimpelde versie)

function vote(id, poll_other, rand, poll_type,u)
{
for(i=0; i {
if(document.formPoll.elements[i].checked)
{answerString +=document.formPoll.elements[i].value + ',';}
}
location.href = '/vote/?va='+u+'&pt='+poll_type+'&r='+rand+'&p='+ id +'&a='+ answerString +'&o='+ otherText;
}

aha

de code location.href zegt tegen de browser om naar en bepaalde url te gaan.
en welk url dat is wordt mede bepaald door de variablelen die we aan de functie vote meegeven.
De "vote" knop roept javascript:vote(1357963,0,0,1,10)op, waardoor we al de url /vote/?va=10&pt=1&r=0&p=1357963&a='+ answerString +'&o=

om de waarde van answerstring te kennen, kijken we weer naar de HTML broncode van de poll waar we <input type="checkbox" id="PDI_answer6978941" value="6978941"></input> atog terugvinden.

answerString vervangen we door "6978941," wat de waarde is van de checkbox voor atog + een komma (dat is het + ',' stuk in de vote functie)

de volledige string wordt dan http://answers.polldaddy.com/vote/?va=10&pt=1&r=0&p=1357963&a=6978941,&o=
en inderdaad: Als we deze url oproepen in de browser, zien we dat er 1 vote bij atog is bijgekomen.

We zouden dan als een gek op refresh kunnen gaan klikken, maar na een paar 100 keer heeft polldaddy ook wel door dat er iets niet klopt en weigert dan nog nieuwe stemmen te tellen van je PC.
Je krijgt dan het volgende

Als je nu een andere PC zou gebruiken, zou je met die URL wel weer verder kunnen stemmen, maar handig is dat niet.
Gelukkig zijn daar verschillende oplossingen voor, en een oplossing die voor url-oproepen goed werkt is een zogenaamde "cgi proxy"
Dit is een script dat op een webserver draait, en als doorgeefluik dient voor webpagina's, zodat de doelwebserver (polldaddy) niet kan zien waar het verzoek eigenlijk vandaan komt.
Bovendien past zo'n proxy script nog wat slimmigheden toe om zich telkens als een andere "pc" te vermommen, waardoor het veel minder kans heeft ook geblokeerd te worden.
Je kunt zo'n script zelf op je server zetten, maar er zijn ook lijsten met publieke cgi proxies (die zijn vrij te gebruiken, al moet je er wel een kwak reclame bij nemen)
de URL http://anonymouse.org/cgi-bin/anon-www.cgi/http://answers.polldaddy.com/vote/?va=10&pt=1&r=0&p=1357963&a=6978941,&o= bijvoorbeeld roept de polldaddy stem pagina op via zo'n proxyscript zodat je zelf buitenschot blijft.
Je kunt zoveel proxy scripts tegelijk gebruiken als je wil, de webserver zal ze immers als verschillende verzoeken aanschouwen.
Dan is het nog zaak dat om de zoveel tijd automatisch te laten herhalen via een cron of een autorefresh en klaar, de tijd doet de rest.

Ik heb het script ongeveer 40 uur laten lopen en in die tijd heeft het ruim 100.000 stemmen uitgebracht.
en voor alle duidelijkheid: atog had niets te maken met deze valsspelerei - hij is uiteraard de eerlijkheid zelfve (EN een terechte winnaar! :-) )

Dit was natuurlijk maar een leutigheids-poll, maar de bottomline is: als je een online tool of spel gebruikt waarbij er ECHT iets belangrijks te winnen valt ... spendeer dan meer dan de helft van je resources aan de beveiliging ervan, want gegarandeerd dat er hopen nerds rondlopen die niets liever doen dan je actie om zeep te helpen door het systeem te kraken.


My first (very simple) Arduino project combines Tikitag to create some magical lamps that change color depending on the objects you put in front of them. (and then the magic is gone as the trick is explained)
The sourcecode of all scripts and programming can be downloaded here.
tikitag

The übercool @bnox hopped over 1000 twitter-followers yesterday and posted her wonderwall of twitter-followers on her blog.
It was generated by a script by Walter Higgins. Cool! Only one thing: I noticed it had only 700 peeps on it. (Actually, I miscounted so thanks @StefaanLesage for the recount )
It's stupid things like this that bug me (litteraly)
I'm conditioned by my job of course: when I see a software bug I automatically switch to "Can we fix it? YES WE CAN!" mode.
I created a little script that gets your followers and displays them in a grid. It turned out to be piece of cake thanks to Twitter's excellent API.
Here's the script if you want to make your own Wonderwall or adapt it.

<%
twitterAccount = "steffest"
twitterPass    = "******"
twitterUser    = "Bnox"
page=1
colcount=1

response.write("<h1>"&twitterUser&"</h1>")
response.write("<table><tr>")
twitter_getfollowers()
response.write("</tr></table>")

function twitter_getfollowers()
	twitterurl = "http://twitter.com/statuses/followers/"&twitterUser&".xml?page=" & page
	set objXMLHTTP = Server.CreateObject("MSXML2.SERVERXMLHTTP")
	objXMLHTTP.Open "GET", twitterurl, false,twitterAccount,twitterPass
	
	objXMLHTTP.Send
	Set objXML = Server.CreateObject("MSXML2.DOMDocument")
	bAns = objXML.loadXML(objXMLHTTP.responseText)
	
	if bAns then
		set objItemNodes = objXML.DocumentElement.SelectNodes("user")
		if objItemNodes.length>0 and page<50 then
			for each oNode in objItemNodes
				user_name = ""
				user_image = ""
				if not oNode.selectSingleNode("screen_name") is nothing then user_name = oNode.selectSingleNode("screen_name").Text
				if not oNode.selectSingleNode("profile_image_url") is nothing then user_image = oNode.selectSingleNode("profile_image_url").Text
				response.write("<td><a href=""http://twitter.com/"&user_name&"""><img src="""&user_image&""" border=""0"" width=""48"" height=""48""></a></td>")
				colcount=colcount+1
				if colcount>15 then 
					response.write("</tr><tr>")
					colcount=1
				end if
			next
			
			page=page+1
			twitter_getfollowers()
		end if
	end if
	
	set objXMLHTTP=nothing
	twitter_getfollowers = true

end function
%>

Wauw - What a great speech that was - the Obama victory speech.
You can rewatch it here and reread it here.
Although he's probably not written it himself, clearly Obama has a way with words and a gift to inspire people with his ideas.
That's a gift, and something the world can use, an inspiring leader, and probably one of the main reasons he won.

It's not a gift that I have :-)
"I'm a developer - I don't do pitches (very well)" I tweeted some time ago at FOWA, when I was picked as 1 of the 3 winners for the Adobe AIR competition that had to present their idea to a expert-panel and to the public.
The video recording of those presentations are now online.
A bit shocking to see yourselves one stage - especially with such a cruel English accent - but well - it was fun :-)
The video is here.
Steffest FOWA Video
My app-idea came accross a bit incomprehensible I'm afraid. I just wanted to cram everything in that one minute. (Big mistake BTW)
It was an idea I woke up with that morning and turned it in a few minutes before deadline, but actually it was just a variation on the little ideas I build for myself all the time: bridging the gap between your PC and the world around you, allowing you to have a two way interaction between your PC and its environment.
That's also why I like the Tikitag project that much: it's another method of interaction to add to the chain: moving RFID-tagged objects around the place to trigger actions on your PC (thus linking a physical object to the web)
Voice recognition, X10 control, webcam controls ... all methods of interaction with the real world around you, thus enriching your experience.

The Relocally thing - As I dubbed it - is another example: what if you could enrich the way you access your online social network by allowing trusted accounts a controlled access to your PC to trigger some event.
Like when you send a tweet with a link to a music file, and that file would be played instantly on the PC's of your connected contacts.
Or what if you (or someone else your trust) could control your (PC based) video recorder - or your lights - or your ... whatever ... by tracking messages from Twitter, facebook, Netlog ...
For example it could listen for colours and adjust the lighting accordingly (probably more suited for public places that what to give the audience some form of interaction)
The though behind this is always the same: make sure all devices are connected to the web in one way or another and are able to receive input from the web, and you'll have a whoppingly cool system that brings the web in your home without being tied to a computer all the time.
Relocally would then enable your remote friends to interact with your environmental experience - and if that would enrich your experience ... why not ?

And then that Richard Moross guy spoiled the moment a bit by asking how I would monetize the app ...
Excuse me ? Monetize it? No thank you, why would you want to monetize on an idea that's about social experience ?
Djeez.

Anyway - probably AIR is not the right platform to build it on because it still has very limited access to the host (e.g. it can't spawn new processes) and probably this idea will end up in one of my homebrewn domotica/automation setups, but still ...
To borrow some Obama words:
    So let us summon a new spirit
    This is our time:
  Can we build it?     YES WE CAN !
Yes We Can

a picture called gearsa.jpg (click to enlarge)

Hoeveel tijd is een developer eigenlijk kwijt met het in topconditie houden van zijn systemen, of het opzetten van nieuwe systemen ?
Veel teveel in ieder geval, en dat is allemaal tijd die je NIET kunt spenderen aan meer nuttige zaken zoals blogs lezen, de live persconferentie volgen van de eerste Google Android phone of - allez vooruit dan - wat ontwikkelwerk doen.

Hier wat dingen die ik deze week nodig had en die naar mijn goesting veel te lang duurden (Ik zet ze hier zodat ik er de volgende keer niet zo lang naar moet zoeken)

  • Om in linux een apt-get install programma weer te verwijderen: apt-get remove
  • Om een NTSC miniDV te capturen (met de Vista video import wizzard) : eerste een seconde de tape afspelen zonder de import te starten, dan de tape pauzeren, dan de import wizzard starten (anders denkt Vista dat het een PAL tape is)
  • Om in IIS7 Classic asp pagina's aan de praat te krijgen:
    • error meldingen naar de browser sturen (ipv de standaard melding) : %windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true
    • om parent paths terug toe te laten: %windir%\system32\inetsrv\appcmd set config -section:asp -enableParentPaths:true
    • om de loadUserProfile voor de Default Application Pool af te zetten (zodat access databases terug benaderbaar zijn)
      %windir%\system32\inetsrv\appcmd set config /section:applicationPools /[name='DefaultAppPool'].processModel.loadUserProfile:false
    • en om dan de Network Service temp directory op read/write rechten te zetten:
      icacls %windir%\serviceprofiles\networkservice\AppData\Local\Temp /grant Users:(CI)(S,WD,AD,X)
      icacls %windir%\serviceprofiles\networkservice\AppData\Local\Temp /grant "CREATOR OWNER":(OI)(CI)(IO)(F)
    • als je dan de oude (en onveilige) beschijvende errormeldingen terug wil om te debuggen
      %windir%\system32\inetsrv\appcmd.exe set config "websitenaam" -section:system.webServer/httpErrors  /errormode:"Detailed" /commit:apphost
      en
      %windir%\system32\inetsrv\appcmd.exe set config "websitenaam" -section:system.webServer/asp /scriptErrorSentToBrowser:"true" /commit:apphost


Bon, genoeg generd !

Audio message by phone: Steffest: Okay, I updated all my blogging scripts and if all goes well this should appear from Twitterfone t...

Click to hear the full recording

update: Ok dat werkte :-) genoeg gepruts nu, hop mijn bed in.
Another day, another social network.

Today all the buzz was about Identi.ca, a twitter clone, but based on the open source Laconica

the 140 char limit posting thing made it an ideal target to hook up to Feedtweeter: Keeping track of all those social networks gets a little insane, so it makes sense to have a tool that syncs all your networks, no ? Post something in twitter or plurk, and it will appear in Identi.ca too.
Here's the post-to-idetica script in VB Identi.ca has no official API yet, but the approach is the same as the Plurk posting: just hit the website and simulate the login and posting forms.


<%
identicaAccount = "Steffest"
identicaPass = "*********"
	
identica("hello identicaworld!")
	
	
function identica(message)
	
	' based on http://monkey.linuxworld.com/scripts/twit
		
	url_login = "http://identi.ca/main/login"
	url_post = "http://identi.ca/notice/new"
	
	' first: login
	useragent = Request.ServerVariables("HTTP_USER_AGENT")
	poststring = "nickname=" & identicaAccount & "&password=" & identicaPass
	set objXMLHTTP = Server.CreateObject("MSXML2.SERVERXMLHTTP")
	objXMLHTTP.Open "POST", url_login, false
	objXMLHTTP.setRequestHeader "User-Agent",useragent 
	objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	objXMLHTTP.Send poststring
			
	' then send the message
		message=server.URLEncode(message)
	poststring  = "status_textarea=" & message
	
	objXMLHTTP.Open "POST", url_post, false,plurkAccount,plurkPass
	objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	objXMLHTTP.Send poststring
		
	identica = objXMLHTTP.responseText
end function

Damn, I can't believe I haven't tought of this approach myself, but Ryan Lim did some digging and pulled an unofficial Plurk API out of his sleeve :-)
I's written in PHP.
Here's the original copyright notice.

I translated the bits needed to post a plurk from a 3th party application to vbscript, for use in feedtweeter.
So a few days after plurk2twitter, twitter2plurk is a fact. (And it works!)
Tomorrow I'll update feedtweeter to be able to post to Plurk.


<%

	plurkAccount = "Steffest"
	plurkPass = "*********"
	
	plurk("hello plurkworld!")
	
	
	function plurk(message)
	
		' big thanks to Ryan Lim for doing the digging
		' translated from http://code.google.com/p/rlplurkapi/
		' this is just a small function to send a plurk
		' for a more complete API: http://code.google.com/p/rlplurkapi/
		
		url_login = "http://www.plurk.com/Users/login?redirect_page=main'"
		url_post = "http://www.plurk.com/TimeLine/addPlurk"
	
		' first: login
		poststring = "nick_name=" & plurkAccount & "&password=" & plurkPass
		set objXMLHTTP = Server.CreateObject("MSXML2.SERVERXMLHTTP")
		objXMLHTTP.Open "POST", url_login, false,plurkAccount,plurkPass
		objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
		objXMLHTTP.Send poststring
	
		' then send the plurk
		lang = "en"
    	qualifier = ":"
    	nocomments = "0"
	
		' get the ISO8601date
		postdate = ISO8601date(now(),"+02")
		
		message=server.URLEncode(message)
	
		poststring  = "posted="&postdate&"&qualifier=" & qualifier& "&content="&message&"&lang="&lang&"&no_comments=" & nocomments & "&limited_to="
	
		objXMLHTTP.Open "POST", url_post, false,plurkAccount,plurkPass
		objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
		objXMLHTTP.Send poststring
		plurk = objXMLHTTP.responseText
		set objXMLHTTP=nothing
	
	end function
	
	function ISO8601date(dt,timezone)
		ISO8601date = year(dt) & "-" &  padding(month(dt)) & "-" &  padding(day(dt)) & "T" & hour(dt) & ":" & minute(dt) & ":" &  second(dt) & timezone & ":00"
	end function
	
	function padding(s)
		if len(s)=1 then
			padding="0" & s
		else
			padding = s	
		end if
	end function


Yesterday I launched a lttle service: www.feedtweeter.com
It's about RSS and about Twitter and about mixing several social medai networks together.
Basically it's a system that keeps track of an RSS feed and processes any new items that appear.
For example: if you post a video on youtube, this will end up in your youtube RSS feed, it gets picked up by tweetfeeder that decides what to with it, like posting it to your blog for example.
So you upload a video to Youtube, and it will appear on your blog automatically.
These days RSS, and XML in general, is the data-glue that ties about any data-driven website together and it's become the standard for moving data between sites or services.
Tweetfeeder tries to be different by adding some spice: it adds a processing layer to the mix so that every item can be slightly altered. For example:
  • when posting to twitter, images and html will be stripped because twitter doesn't display that
  • commercial messages can be stripped
  • you can define some special chars like: "when a tweet starts with *, post it to my blog" or "when a flickr image contains the tag "granny", send it by email to grandma"
  • and endless other variations

The twitterstream on the left is an example of that also.
At the moment feedtweeter focuses on getting messages from Plurk to Twitter: You write something in Plurk and it also appears in Twitter.
It's in closed beta for the moment, so if you want an invite: send me a tweet (And follow me on twitter so I can send you your login by direct message, offcourse you can unfollow me after that)
it's based on this code I put together 2 days ago, allthough its heavely modified and optimised (and ported to .net)
I spend 1 evening building the website (graphics and HTML) and 1 night doing the code (user accounts, feed management, message queue management)
It has launched yesterday, has currently about 40 users and has processed 1100 messages.
Now ... if only Plurk and Twitter would stay up and running, as both platforms have had hickups today ... *sigh*

Rrradiogirrrl posted a nice little review.

Allez vooruit ... ik kon het toch niet laten.
Plurk is leuk, maar Twitter is ook leuk.
Zucht, en kiezen is moeilijk!
Maar dikwijls is kiezen ook helemaal niet niet nodig!
Plurk heeft helaas (nog) geen API, maar wel een RSS (Atom) feed waar we iets mee kunnen doen, bijvoorbeeld: posten naar twitter.

Dit is het script:
Het scant de Plurk RSS feed en post elke nieuwe plurk naar twitter.
(kheb uiteraard wel mijn paswoord eruit gehaald)
Quick & Dirty (jummie !)
maar werkt goed genoeg voor 1 persoon.


Read more