China Post EMS API / CSV download - php

I'm building a courier tracking application for a client. It's the second I've done, so far having worked with UPS, TNT, AAE and BPost. All have APIs or CSV downloads which can be used.
I'm working in Codeigniter.
I just wondered if anyone has experience of automating tracking with China Post EMS service? The only way to get tracking data it seems is by entering a tracking code / captcha either singly or in batches of 10. Not very practical for my client who deals with 500-1000 consignments per month.
I've searched for about 4 hours this morning on how to do this, I tried calling China Post (but don't speak Chinese so didn't get anywhere with that), have emailed (no reply yet) also.
Now my client is talking about abandoning the project if we can't get this to work - problem is unless I can find a method of retrieving data, I don't see how this can be achieved.
If you have come across this issue before (and looking at Google I can see I'm not the only developer who has come across this problem) please let me know your solution.

I know this is an old question, but I've been looking for a solution to the same issue, now, what I found as a potential solution is this:
I found a Python GUI script that uses track-chinapost.com and a captcha breaker in order to get the tracking information
Another potential solution is using the AfterShip API which supports china post among many other couriers, but it is pretty expensive and I don't think it suits your context...
If you have found other solutions, please let me know...

Related

Sending a notification of a Paypal transaction to an IRC Bot, either directly or via intermediary webpage

Firstly this is my first question so I apologize if it not up to standards.
TL:DR -
I need to be able to get a notification of a Paypal transaction with the amount, and message, if any to an IRC bot. I am thinking about a webpage to take the transaction and notify the bot. I was hoping to use PHP for the webpage and this for the IRC bot: willie.dftba.net - An open source Python IRC Bot.
Long Format -
Context:
I am attempting to create a webpage that will take a Paypal transaction, then send a notification containing the amount and the message the user left(if any) to the IRC Bot.
The reasoning behind using a webpage over having the bot query the Paypal API directly is to avoid spamming Paypal while at the same time reducing the communication to a notification only when an event occurs.
The webpage will likely be running on a hosted webserver that I have little control over. I am familiar with PHP, my Javascript is not so great though.
The IRC bot has not yet been created, I was hoping to utilize willie.dftba.net for the bot, it's Open source and in Python. The bot will be running on a Windows machine most likely. Other options for IRC bots should probably be left to the comments. The bot will be doing other things outside the scope of this question. Though this is a critical function for the bot.
Answers I'm looking for:
What sort of technologies or libraries for the languages I am trying to use can help me achieve this as simply as possible? Please state why.
Suggestions that are within the scope of this question:
Using different technologies, languages, or APIs than I mentioned if it will make the job easier/faster. Please state why.
Why am I asking?
I am asking this question because there seems to many possible technologies or APIs I could utilize but I am not experienced enough to ascertain which route I should head down. I am honestly at a loss right now.
Background on my Knowledge & Experience:
For web technologies, I am familiar with HTML, PHP CSS, & a little Javascript.
For programming languages I have taken a few classes covering basic C++, Visual Basic .NET, and some Java.
I have messed around with Python a little over a decade ago when modding a game.
I have created, or helped to create a dozen or so smaller websites. I have used things like Jquery before but in an extremely limited fashion, my PHP is much stronger than my Javascript.
I have made a few simple command line C++ & Java programs as learning exercises.
I have made many simple VB.NET applications and 3 practical use, but small applications.
Research I have conducted:
I have searched Google, and here for possibilities, and have several links that I have looked through. While I must admit I have not read every single word on every single link, I have read a fair portion and skimmed a lot of the rest. And clicked on many links within the pages I am about to reference here. For the sake of not posting the entire internet, I am only posting the starting links.
After typing this all up, I discovered it will not let me post more than two links so I have had to alter these links.
willie.dftba.net
php.net/manual/en/book.sockets.php
socket.io
www.npmjs.com/package/socket.io
stackoverflow.com/questions/6398887/using-php-with-socket-io
www.htmlgoodies.com/html5/other/create-a-bi-directional-connection-to-a-php-server-using-html5-websockets.html#fbid=XmAMX7ESMm7
stackoverflow.com/questions/14418950/broadcast-notification-to-multiple-users-at-the-same-time-php-mysql-ajax
cometdaily.com/maturity.html
stackoverflow.com/questions/12284565/how-to-communicate-between-a-php-and-a-c-application-through-a-socket
davidwalsh.name/nodejs-irc
sourceforge.net/projects/phpsmartirc/
Final Thoughts:
Thank for reading this question and devoting some of your time and energy to this question, it is highly appreciated! I really hope I have been thorough & specific enough.
You've been pretty broad with your questions, so I'll be broad with my answer.
I would recommend sticking with PHP and setting up an Instant Payment Notification (IPN) solution for your PayPal account.
That will send POST data about any transaction that hits in your PayPal account in real-time. You can use it to automate tasks based on payments, refunds, disputes, cleared payments when they're pending, etc.
There are lots of good IPN packages for PHP available on GitHub/Packagist. If you happen to be working with WordPress, take a look at my PayPal IPN for WordPress plugin, and on that note, if you are using WordPress I'll assume you're using WooCommerce, so I'd also take a look at my PayPal for WooCommerce plugin.
For API calls, I would recommend taking a look at my class library for PayPal. It will make any API call you need to make with PayPal very quick and easy, and it is also available on GitHub and Packagist.
Those tools should give you everything you need to get any PayPal task you need done.

How do I investigate a dropped php session bug that I can't replicate?

On one of my clients e-commerce site (my own php code adapted from oScommerce) is getting reports of "customers going to the checkout to find their basket is empty".
This would indicate either php sessions/cookies are somehow getting dropped or something is going wrong when switching to the secure server. There's nothing clever going on here, just standard html forms, some basic javascript for form validation and the php.
I have tried to reproduce this in many many ways and I've never seen the problem come up.
The customers who phone my client to say its happening never seem to have anything in common - time of day, browser, location, device type. It just seems totally random.
The overall conversion rate of the site hasn't dropped so it would see this is only happening for a tiny number of users.
My hosting company have given the server a once over and found no problems, so I'm now drawing a blank. Anyone got any suggestions on what I can test next?

Synchronisation of multiple off-line web pages

I am struggling with the logistics of getting a multi-device synchonisation to work.
Lets say I have an off-line web page (via app-cache) used as an address book - how would I go about structuring a robust multi-device synchronisation system.
I was thinking about the following but it doesn't seem robust:
Each device has 2 tables:
'synchronised (copy of server table at last update time) - along with the servers time-stamp at the last update point.
'awaiting synchronisation' - changes on that device waiting to be synchronised with the server. - this could have insert, delete and update items.
Then when the device connects to the server it:-
Uploads all changes to the server (via a mini API) and delete them from the 'awaiting synchronisation' table.
Sends the server the last synchonisation time.
Then download all updates from that time onwards and add them to the 'synchronised' table on the device.
Update the synchronization time. (using server time to ensure consistency across devices)
Would that work or would it fall over?
Like I said never tried a multi-device synchronisation and seems to be a hard thing to find topics on.
Finally are there any frameworks designed for this?
Anyone who has done similar with an App maybe as off-line web pages are rare - just need the logical order and any 'gotchyas' I need to be aware of.
Thanks in advance.
It can be tough to do that, in the end I realised that what I needed to do is create a version control system, similar to GIT... in JavaScript. Once you have the versions you can make reasoned decisions based on a change version number and the change that it was based upon.
I don't know if the project I started will be useful for you, it uses these concepts, but even if it is not I feel you should read through the documentation as it will help you think about how to tackle the wider problem. The project is stalled right now as I am looking for work (which is a lot of work) but I will be picking it up again soon.
Matt Forrester

How does one go about incorporating location based services into a social network?

I am currently working on a special interest social network. The part that I'm having trouble with is the location of individual users.
My ideal solution would be a system where users enter their city/state and/or zip code, and could search for other users within their own area.
What I think separates my question from many existing threads is my needs and my resources. I don't have much capital at all to invest in a paid database, nor do i need all the features offered by the ones i've come across. I'm really looking for suggestions in which direction I need to go in. I've seen a lot of threads with similar ideas, but none that give the type of answers i need for my project. I'm not sure where to start with this, so any help would be greatly appreciated!!
Also, I'm building my application in php5.
these barebones hosting packages include MySQL... 1and1.com
so you could store the locations, and use the Haversine formula to find nearby users: http://code.google.com/apis/maps/articles/phpsqlsearch.html#findnearsql
For getting the data in Lat/Lng format, you could consider using navigator.geolocation...it's fairly well supported, but you could do a test for it: if(navigator.geolocation) and if it's NOT, provide a text field for city/state or ZIP, and then geocode that to get to Lat/Lng (google has a service here: http://code.google.com/apis/maps/documentation/geocoding/ ) but it does have some limitations, like 2500 queries/day unless you pay for an upgraded license
Actually, even if the navigator approach is available, you might want to provide a confirmation step (in case their ISP is returning an different location)...like "you appear to be HERE, is this accurate, or would you like to supply your own location"
Thank you Robot Woods, Your answer inspired some creative googling that lead me to the answer to my problem. Yahoo offers PlaceFinder! http://developer.yahoo.com/geo/placefinder/
PlaceFinder can be used to get a Latitude/Longitude from a user inputted city/state combination or a zip code. And best of all... Its Free!!! Fits my budget perfectly!

Multiple chat rooms, technologies and server load,

I am working on a website where I need multiple chat rooms. Each room will be generated and tied to the content/event just generated by the user and will aproximately last 15 minutes and then autodestroyed. One room will contain aprox. 15 users. Many events will co-exist at the same time.
I have been googling around a lot recently looking for the most appropriate but still easily implementable solution. What I came across are three main paths:
using a mysql-php ready made script (ie. phpfreechat, x7 chat)
using irc channels created on the fly through an ajax or flash web frontend embeded as an iframe (lightirc, qwebirc, mibbit, (advice more if u want))
using some lively generated hosted chatrooms (ie. everywherechat.com, gabbly (i really need to know more of those, again, advice if you can).
Still I have many doubts on all this: irc frontends cant be customized as much as I'd need (ie. disable kick or ban functionalities). Php-mysql solutions, on the other hand, make me think there will be a lot of server load concerns with such a big user-base.
I am on a paid but non dedicated hosting plan. Php memory limit set to 64mb kind of stuff. How many users at the same time would that hold? Hosted solutions are the easiest ones, but can you recommend one that allows rooms to be created on the fly by just passing in some parameters? (no registration, just a quick-easy-flying chatroom).
I know many of these questions are not strictly programming related but more technology related. But still a programming related answer could help me sort out the right direction. So your contribution is really appreciated. Thanks ! Sorry for being long

Categories