to get a 24hour internet cafe in Barcelona. Some of them are open round the clock at weekends, but midnight is the normal closing time during the week.
You might consider the Paraiso Travellers Hostel on
Ronda de San Pablo. It costs around 29 Euros for the night, but for that you get free wireless internet access round the clock - if you have a laptop of course.