Re: [WebDNA] USPS shipping calculator

This WebDNA talk-list message is from

2012


It keeps the original formatting.
numero = 107897
interpreted = N
texte = Here is a UPS example, but not sure if the url in the code is still valid. WebCatalog/UPS Quick Cost Calculator [!]Hook into UPS Online If Desired[/!] [!]Contact UPS and get their response[/!] [showif [total]<1][math show=3Df]total=3D1[/math] [/showif] [text]response=3D[middle startafter=3DUPSOnLine&endbefore=3D][tcpconnect host=3Dwww.ups.com&port=3D80][tcpsend]GET /using/services/rave/qcostcgi.cgi?accept_UPS_license_agreement=3Dyes&10_act= ion=3D3&14_origCountry=3DUS&15_origPostal=3D[lookup db=3Dadmin/ups.db&lookinfield=3Dshr_id&value=3DUPSONLINE&returnfield=3Dshr_= zip¬found=3D92656]&22_destCountry=3DUS&19_destPostal=3D[GetChars start=3D1&end=3D5][shiptozip][/GetChars]&49_residential=3DNO&47_rate_chart= =3DRegular+Daily+Pickup&48_container=3D00&13_product=3D[getchars start=3D11][shipvia][/getchars]&23_weight=3D[total]&weight_std=3Dlbs. HTTP/1.0 [UnURL]%0D%0A%0D%0A[/UnURL][/tcpsend][/tcpconnect][/middle] [/text] [!]Get the response code from the result[/!] [text]response_code=3D[getchars start=3D1&end=3D1][response][/getchars][/te= xt] [showif [response_code]=3D3] [!]If the package was priced, parse the results for cost[/!] [!]UPS returns a percent delimited string where the 10th item in the list is the total cost[/!] [!]We put the index of each percent in a text var named 1,2,3...[/!] [math show=3Df]count=3D0[/math] [loop start=3D1&end=3D[countchars][response][/countchars]] [showif [getchars start=3D[index]&end=3D[index]][response][/getchars]=3D%][math show=3Df]count=3D[count]+1[/math][text][count]=3D[index][/text] [/showif] [/loop] [!]Get the charged based on the character starting after the 10th % and ending before the 11th percent[/!] [text]total_charge=3D[getchars start=3D[math][10]+1[/math]&end=3D[math][11]-1[/math]][response][/getchars]= [/text] [setheader cart=3D[cart]]shipcost=3D[format .2f][math][total_charge]*(1+([lookup db=3Dadmin/ups.db&lookinfield=3Dshr_id&value=3DUPSONLINE&returnfield=3Dshr_= markup¬found=3D0]/100))[/math][/format] [/setheader] [/showif] [showif [response_code]!3] [!]Do something here is there was a problem[/!] [text]13_product=3D[getchars start=3D11][shipvia][/getchars][/text] [text]19_destPostal=3D[GetChars start=3D1&end=3D5][shiptozip][/GetChars][/t= ext] [search db=3Dz_[13_product].db&leZIP1datarq=3D[GetChars start=3D1&end=3D3][19_destPostal][/GetChars]&gezip2datarq=3D[GetChars start=3D1&end=3D3][19_destPostal][/GetChars]] [founditems] [search db=3D[13_product].db&eqweightdatarq=3D[total]] [founditems] cost =3D $ [Format 10.2f][interpret][[zone]][/interpret][/format]
[/founditems] [/search] [/founditems] [/search]
[!] Shipping charges are currently unavailable for the destination postal code selected. You will be notified separately about shipping costs. [/!] [/showif] On Mon, Jan 2, 2012 at 9:39 AM, wrote: > I ended up just doing it :-) > > All I needed was a simple shipping calculator for priority mail, which is > rather quick and painless to code as far as APIs go. > > Thanks Steve, and for anyone else doing these types of things, I think it > would be awesome to share code for communicating with various API's and > cloud services. =A0While certainly we may have reservations to offer up > specific items freely, there is typically code examples, frameworks, etc = in > PHP, Perl, and so forth=A0freely available in many cases. =A0It will be > tremendous for future WebDNA programmers to have similar resources they c= an > discover and use. > > I do plan to develop more for the shipping services down the line here. = =A0As > of now though, I've created some neat mashups either through API's or sim= ple > RSS feeds such as: > #CafePress store > #Twitter > #Google Checkout > #Google Calendar > #Youtube > #Ebay Store > #Amazon affiliate > #UPS > #USPS > > I'm hoping to get into Facebook integration rather soon. =A0And while I h= ave > not gone as deep as one could into each of these services, I do at least > have some familiarity and code that could help another programmer get > started. > > > On Jan 2, 2012, at 1:33 AM, Steve Raslevich wrote: > > Hello Aaron, > > Actually I subbed that exact job out to a friend. It is tracking and > submitting shipments.=A0 I spoke with him last week and he told me he was > finishing it up. Would you happen to have a FedEx tracking API=A0 or a > distance between zipcodes calculator to trade? Feel free to email me > directly. > > Regards, > Steve > > aaronmichaelmusic@gmail.com wrote: > > Anyone by chance have a working shipping calculator for USPS??? > > The USPS API actually looks fairly easy, but it would be nice to save a > little time. I've built a UPS calculator that I'm willing to offer up as > something to give back, or possibly a few other WebDNA scripts I've writt= en > to work with various APIs (ie Google & Amazon services) > > > Thanks!--------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list . To unsubscri= be, > E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug > Reporting: support@webdna.us > > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list . To unsubscri= be, > E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug > Reporting: support@webdna.us Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] USPS shipping calculator (sal danna 2012)
  2. Re: [WebDNA] USPS shipping calculator (sal danna 2012)
  3. Re: [WebDNA] USPS shipping calculator (aaronmichaelmusic@gmail.com 2012)
  4. Re: [WebDNA] USPS shipping calculator (Steve Raslevich 2012)
  5. [WebDNA] USPS shipping calculator (aaronmichaelmusic@gmail.com 2012)
Here is a UPS example, but not sure if the url in the code is still valid. WebCatalog/UPS Quick Cost Calculator [!]Hook into UPS Online If Desired[/!] [!]Contact UPS and get their response[/!] [showif [total]<1][math show=3Df]total=3D1[/math] [/showif] [text]response=3D[middle startafter=3DUPSOnLine&endbefore=3D][tcpconnect host=3Dwww.ups.com&port=3D80][tcpsend]GET /using/services/rave/qcostcgi.cgi?accept_UPS_license_agreement=3Dyes&10_act= ion=3D3&14_origCountry=3DUS&15_origPostal=3D[lookup db=3Dadmin/ups.db&lookinfield=3Dshr_id&value=3DUPSONLINE&returnfield=3Dshr_= zip¬found=3D92656]&22_destCountry=3DUS&19_destPostal=3D[GetChars start=3D1&end=3D5][shiptozip][/GetChars]&49_residential=3DNO&47_rate_chart= =3DRegular+Daily+Pickup&48_container=3D00&13_product=3D[getchars start=3D11][shipvia][/getchars]&23_weight=3D[total]&weight_std=3Dlbs. HTTP/1.0 [unurl]%0D%0A%0D%0A[/UnURL][/tcpsend][/tcpconnect][/middle] [/text] [!]Get the response code from the result[/!] [text]response_code=3D[getchars start=3D1&end=3D1][response][/getchars][/te= xt] [showif [response_code]=3D3] [!]If the package was priced, parse the results for cost[/!] [!]UPS returns a percent delimited string where the 10th item in the list is the total cost[/!] [!]We put the index of each percent in a text var named 1,2,3...[/!] [math show=3Df]count=3D0[/math] [loop start=3D1&end=3D[countchars][response][/countchars]] [showif [getchars start=3D[index]&end=3D[index]][response][/getchars]=3D%][math show=3Df]count=3D[count]+1[/math][text][count]=3D[index][/text] [/showif] [/loop] [!]Get the charged based on the character starting after the 10th % and ending before the 11th percent[/!] [text]total_charge=3D[getchars start=3D[math][10]+1[/math]&end=3D[math][11]-1[/math]][response][/getchars]= [/text] [setheader cart=3D[cart]]shipcost=3D[format .2f][math][total_charge]*(1+([lookup db=3Dadmin/ups.db&lookinfield=3Dshr_id&value=3DUPSONLINE&returnfield=3Dshr_= markup¬found=3D0]/100))[/math][/format] [/setheader] [/showif] [showif [response_code]!3] [!]Do something here is there was a problem[/!] [text]13_product=3D[getchars start=3D11][shipvia][/getchars][/text] [text]19_destPostal=3D[GetChars start=3D1&end=3D5][shiptozip][/GetChars][/t= ext] [search db=3Dz_[13_product].db&leZIP1datarq=3D[GetChars start=3D1&end=3D3][19_destPostal][/GetChars]&gezip2datarq=3D[GetChars start=3D1&end=3D3][19_destPostal][/GetChars]] [founditems] [search db=3D[13_product].db&eqweightdatarq=3D[total]] [founditems] cost =3D $ [Format 10.2f][interpret][[zone]][/interpret][/format]
[/founditems] [/search] [/founditems] [/search]
[!] Shipping charges are currently unavailable for the destination postal code selected. You will be notified separately about shipping costs. [/!] [/showif] On Mon, Jan 2, 2012 at 9:39 AM, wrote: > I ended up just doing it :-) > > All I needed was a simple shipping calculator for priority mail, which is > rather quick and painless to code as far as APIs go. > > Thanks Steve, and for anyone else doing these types of things, I think it > would be awesome to share code for communicating with various API's and > cloud services. =A0While certainly we may have reservations to offer up > specific items freely, there is typically code examples, frameworks, etc = in > PHP, Perl, and so forth=A0freely available in many cases. =A0It will be > tremendous for future WebDNA programmers to have similar resources they c= an > discover and use. > > I do plan to develop more for the shipping services down the line here. = =A0As > of now though, I've created some neat mashups either through API's or sim= ple > RSS feeds such as: > #CafePress store > #Twitter > #Google Checkout > #Google Calendar > #Youtube > #Ebay Store > #Amazon affiliate > #UPS > #USPS > > I'm hoping to get into Facebook integration rather soon. =A0And while I h= ave > not gone as deep as one could into each of these services, I do at least > have some familiarity and code that could help another programmer get > started. > > > On Jan 2, 2012, at 1:33 AM, Steve Raslevich wrote: > > Hello Aaron, > > Actually I subbed that exact job out to a friend. It is tracking and > submitting shipments.=A0 I spoke with him last week and he told me he was > finishing it up. Would you happen to have a FedEx tracking API=A0 or a > distance between zipcodes calculator to trade? Feel free to email me > directly. > > Regards, > Steve > > aaronmichaelmusic@gmail.com wrote: > > Anyone by chance have a working shipping calculator for USPS??? > > The USPS API actually looks fairly easy, but it would be nice to save a > little time. I've built a UPS calculator that I'm willing to offer up as > something to give back, or possibly a few other WebDNA scripts I've writt= en > to work with various APIs (ie Google & Amazon services) > > > Thanks!--------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > Bug Reporting: support@webdna.us > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list . To unsubscri= be, > E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug > Reporting: support@webdna.us > > > --------------------------------------------------------- This message is > sent to you because you are subscribed to the mailing list . To unsubscri= be, > E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug > Reporting: support@webdna.us sal danna

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

RE: 2nd WebCatalog2 Feature Request (1996) [WebDNA] grep question (2009) Web Catalog 2 demo (1997) Pithy questions on webcommerce & siteedit (1997) When do we get to request new features? (1999) WebCatalog2 Feature Feedback (1996) Search/sort in URL Was: GuestBook example (1997) Passing WebCat data to SSL server (1997) Snake Bites (1997) Country & Ship-to address & other fields ? (1997) [WebDNA] Sandbox question (2009) ShowNext for method=POST (1997) Date Range search (1997) Problems with webcat 2.01 for NT (1997) Error cart approval pending (2005) How to search dbs across virtual hosts for same domain? (2003) WebCatalog dying in WebTen Revisited (1998) Unexpected error (1997) PIXO support (1997) Where's Cart Created ? (1997)