Topic: Tracking Number - Automatic integration

Hello, is it possible to add a tracking number and a script to look for a website and update the tracking number status automaticly?
Many thanks

Re: Tracking Number - Automatic integration

Hello.


it depends on the website.


There is function to HTTPGet to get html page to variable like text, after that you can parse this text to get tracking number status, example:

var
   s: string;
begin
   s := HTTPGet('http://bgpost.bg/IPSWebTracking/IPSWeb_item_events.asp?itemid=RF3676432678HK');
Dmitry.

Re: Tracking Number - Automatic integration

thanks!
I'm rebooting my database from scratch, due to many bugs and not planning things right, i decided to start from 0.
I was also wondering, is it possible to export this interface to HTTP server?
many thanks

Re: Tracking Number - Automatic integration

VascoMorais wrote:

I was also wondering, is it possible to export this interface to HTTP server?
many thanks

Can you explain in more details, what do you mean?

Dmitry.

Re: Tracking Number - Automatic integration

instead of using the interface made by my visual database, export this to an https website running on apache (example)

Re: Tracking Number - Automatic integration

VascoMorais wrote:

instead of using the interface made by my visual database, export this to an https website running on apache (example)

It's nice idea, but impossible.

Dmitry.

Re: Tracking Number - Automatic integration

Okay, so HTTPGET will work, but the "data" i receive is the entire "HTTP" Website.
Is there a way to filter what i want?

Re: Tracking Number - Automatic integration

VascoMorais wrote:

Okay, so HTTPGET will work, but the "data" i receive is the entire "HTTP" Website.
Is there a way to filter what i want?

Yes, you should use function Pos to find data and function Copy to get data. Let me know URL, where you want to get data, I'll try to make an example for you.

Dmitry.

Re: Tracking Number - Automatic integration

if you can show me in this example, maybe i can use it as soon as i find a good "universal tracking" website.

File here:

https://ufile.io/y9jyx

Re: Tracking Number - Automatic integration

Unfortunately I don't have actual track code to test it fully, example


procedure click (Sender: TObject; var Cancel: boolean);
var
   s: string;
   track: string;
begin
   track := form1.edit1.Text;
   s := HTTPGet('http://bgpost.bg/IPSWebTracking/IPSWeb_item_events.asp?itemid='+track+'');

   if Pos('<p align="center"><strong>No information, please check your item identifier</strong> </p>', s)> 0 then form1.memo1.Text := 'No information'
   else if Pos('<td align="center" width="18%">Грешен код на пратката </td>', s) then form1.memo1.Text := 'Wrong code';

   //form1.memo1.Text := s;
end;
Dmitry.

Re: Tracking Number - Automatic integration

Doesn't matter, i will follow your example and make it work, as soon as i have this example ready i shall post it here for other people to use it.

Thanks

DriveSoft wrote:

Unfortunately I don't have actual track code to test it fully, example


procedure click (Sender: TObject; var Cancel: boolean);
var
   s: string;
   track: string;
begin
   track := form1.edit1.Text;
   s := HTTPGet('http://bgpost.bg/IPSWebTracking/IPSWeb_item_events.asp?itemid='+track+'');

   if Pos('<p align="center"><strong>No information, please check your item identifier</strong> </p>', s)> 0 then form1.memo1.Text := 'No information'
   else if Pos('<td align="center" width="18%">Грешен код на пратката </td>', s) then form1.memo1.Text := 'Wrong code';

   //form1.memo1.Text := s;
end;