0

Regards. I have a technical problem, but the solution is probably conceptual.

I'm using Twitter Streaming Api with cURL (PHP), and saving the stream into a file. I then use another script to read the contents of the file and parse the tweets. So far so good.

The only problem I have is that, for some reason, when a tweet is pushed into the curl file AND it has more than 4096 bytes (in json format), it is truncated to 4096 and, thus, I loose the tweet cause I can't parse it.

My questions are:

Why does curl truncate the line to 4096 bytes?

How can I solve this easily? I would just need cURL to write more than 4096 bytes to a single line or similar.

I'm sure many of you that have worked with twitter streaming api have found yourselves in the same situation.

Thanks.

UPDATE:

I just got a tweet string with more than 4096 bytes and there's no problem with the file. I'm not sure what to think now.

Hold your horses.

Dandy
  • 303
  • 5
  • 14
  • AFAIK curl in PHP only truncates URL values to 4096 bytes per the spec. Are you sure you're sending your values as part of the request body? – DeaconDesperado Nov 03 '13 at 16:30
  • I'm not sending values. I'm receiving them from twitter streaming api. But I have news: Updated in the question. – Dandy Nov 03 '13 at 16:35

0 Answers0