473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Persistent HTTP Connections with Python?

Hello All,

I am trying to write a python script to talk to an xml-based stock feed
service. They are telling me that I must connect and login, and then
"issue refresh requests" to fetch the data. This sounds a lot (to me)
like HTTP 1.1 persistent connections. Can I do that with the urllib
functions, or do I need to use the httplib functions for this kind of
work. Pointers and/or sample code would be much appreciated.

Thanks!

-scott
Jan 10 '08 #1
2 4037
On Jan 10, 10:46 am, Scott Sharkey <sshar...@linuxunlimited.com>
wrote:
Hello All,

I am trying to write a python script to talk to an xml-based stock feed
service. They are telling me that I must connect and login, and then
"issue refresh requests" to fetch the data. This sounds a lot (to me)
like HTTP 1.1 persistent connections. Can I do that with the urllib
functions, or do I need to use the httplib functions for this kind of
work. Pointers and/or sample code would be much appreciated.
Your questions leaves out all important details like the exact nature
of the API being provided. I highly doubt HTTP persistent connections
has anything to do with what you will need to connect to there
service.

Services like this normally come with example code, i recommend you
get access to that.

Regards,
Ivan Novick
http://www.0x4849.net
Jan 11 '08 #2
On Jan 10, 12:46*pm, Scott Sharkey <sshar...@linuxunlimited.com>
wrote:
Hello All,

I am trying to write a python script to talk to an xml-based stock feed
service. *They are telling me that I must connect and login, and then
"issue refresh requests" to fetch the data. *This sounds a lot (to me)
like HTTP 1.1persistentconnections. *Can I do that with the urllib
functions, or do I need to use the httplib functions for this kind of
work. *Pointers and/or sample code would be much appreciated.

Thanks!

-scott
I used to work in the financial industry and I have seen this.
It is sort of like the XML RSS feed that web sites provide -- but like
many financial protocols they created their own standard.
Python httplib can be used to create a SERVER for persistent HTTP
connections -- but want you want is a client.
I think this is actually very simple.
What happens when you open the data URL with a web browser ?
Does the connection stay open and automatically update each time there
is new data ?
If so, just use urllib, leave the connection open and do a read()
every so often to see if there is new data.
Good luck!
-Rob

Jan 12 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Randell D. | last post by:
Folks, I currently connect to my db with PHP code that uses non-persistent connections. I've read that persistent connections can help performance since a connection to the db will use an...
2
by: Steve Jenkins | last post by:
Wonder if anyone can help. So, I've read: >> http://uk2.php.net/function.mysql-pconnect >> http://uk2.php.net/manual/en/features.persistent-connections.php Can one seriously see persistent...
3
by: Derek Fountain | last post by:
For a low-ish traffic website that is doing the simple "build pages from HTML templates and info in a database" kind of thing, do the wise folks in this newsgroup advocate connecting and...
5
by: Felix E. Klee | last post by:
I've set up a PHP web application where users can log in and open a connection to a NNTP-server. There is a *one-to-one* relationship between sessions and NNTP-connections (i.e. exactly one...
16
by: Paul Rubin | last post by:
I've had this recurring half-baked desire for long enough that I thought I'd post about it, even though I don't have any concrete proposals and the whole idea is fraught with hazards. Basically...
1
by: Chris Spencer | last post by:
I noticed the SimpleXMLRPCServer/ServerProxy creates a new socket for remote procedure call. I've written a simple IP based authentication scheme for the Server, and I'd like to include the port in...
2
by: Jim Hubbard | last post by:
Is it possible to have persistent connections in ASP.Net?
6
by: David Rasmussen | last post by:
I use urllib2 to do some simple HTTP communication with a web server. In one "session", I do maybe 10-15 requests. It seems that urllib2 opens op a connection every time I do a request. Can I...
9
by: mel | last post by:
Hi all, I need a persistent TCP connection with my web server over page reloads. This means that, even if the user goes to a different page (in my domain), I want to keep a TCP connection...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.