Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: ph_geturl Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: September 14 2008 at 21:35 | IP Logged Quote mustangcoupe

I am using TonyNo's CID Macro as I seem to still have problems with the plugin. So I figured I'd try to take it one step further. If I do not know who is calling (ex. not in my CID.INI file I would look them up on the internet. I was trying with 411.com but I am having a problem getting the page. If I hit it in iexplorer or FF I get correct data (name/address for the phone number) but in PH I do not get the info I am looking for(I really just want their name). I was planning on trying to use regex to parse the data and pull this out. Can anyone give me any idea?

ph_geturl("http://www.411.com/search/ReversePhone?full_phone ='[LOCAL1]'&localtime=survey")

local 1 contains the cdi info ###-###-####

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: September 15 2008 at 09:15 | IP Logged Quote BeachBum

I was able to get it to work by adding a + after LOCAL


full_phone ='[LOCAL1]'+&localtime=survey


__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: September 15 2008 at 10:01 | IP Logged Quote BeachBum

Further testing revealed there is a redirect that has to be added in-order to be able to parse the fields.

full_phone ='[LOCAL1]'+&localtime=survey&redir=2


__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: September 15 2008 at 12:53 | IP Logged Quote mustangcoupe

Thanks Pete I will try this tonight.

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: September 16 2008 at 11:55 | IP Logged Quote mustangcoupe

Thanks Peta, that worked... now I need to get TONY's help with ph_regex......

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: September 16 2008 at 21:08 | IP Logged Quote BeachBum

May be I can help you here. This code works but could be cleaned up.

ph_geturl("http://www.411.com/search/ReversePhone?full_phone =XXX-XXX-XXXX+&localtime=survey&redir=2")
posw( "[LOCAL1]", "FIRST_ESC_=" )
posw( "[LOCAL1]", "&", [TEMP4] )
mid("[LOCAL1]", [TEMP4] + 11 , [TEMP1] - [TEMP4] - 11 )
posw( "[LOCAL1]", "LAST_ESC_=" )
posw( "[LOCAL1]", "&", [TEMP5] )
mid("[LOCAL1]", [TEMP5] + 10 , [TEMP1] - [TEMP5] - 10 )
ph_tts("[TEMP4]}" + "   " + "[TEMP5]")



__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 
mustangcoupe
Super User
Super User
Avatar

Joined: August 08 2003
Location: United States
Online Status: Offline
Posts: 308
Posted: September 16 2008 at 22:03 | IP Logged Quote mustangcoupe

Thanks Pete, with your code above I did the following....

I was alittle confused about which line saves to and gets data from which variable but I figured it out. Now to finish it

Code:

insert into macroheader values ('LOOKUP PHONE','lookup phone numbers',0,0,1);
insert into macrodetail values ('LOOKUP PHONE',1,15,'[LOCAL1]',NULL,'right(left("{CID}",15),14)',0,'');
insert into macrodetail values ('LOOKUP PHONE',2,15,'[TEMP1] ',NULL,'ph_geturl("http://www.411.com/search/ReversePhone?fu ll_phone=''[LOCAL1]''+&localtime=survey&redir=2")',0,'');
insert into macrodetail values ('LOOKUP PHONE',3,15,'[TEMP4]',NULL,'posw( "[LOCAL1]", "FIRST_ESC_=" )',0,'');
insert into macrodetail values ('LOOKUP PHONE',4,15,'[TEMP1]',NULL,'posw( "[LOCAL1]", "&", [TEMP4] )',0,'');
insert into macrodetail values ('LOOKUP PHONE',5,15,'[TEMP6]',NULL,'mid("[LOCAL1]", [TEMP4] + 11 , [TEMP1] - [TEMP4] - 11 )',0,'');
insert into macrodetail values ('LOOKUP PHONE',6,15,'[TEMP5]',NULL,'posw( "[LOCAL1]", "LAST_ESC_=" )',0,'');
insert into macrodetail values ('LOOKUP PHONE',7,15,'[TEMP2]',NULL,'posw( "[LOCAL1]", "&", [TEMP5] )',0,'');
insert into macrodetail values ('LOOKUP PHONE',8,15,'[TEMP7]',NULL,'mid("[LOCAL1]", [TEMP5] + 10 , [TEMP2] - [TEMP5] - 10 ) ',0,'');
insert into macrodetail values ('LOOKUP PHONE',9,24,'No TTS',1,'"[TEMP6]"+" "+"[TEMP7]"',0,'');



again this is based off of TonyNo's CID Macro, it may also work with the CID plugin or maybe could be added in a way to the plugin. My final intent is to lookup who it is so if there is no name with the CID data I can look them up on the net, and store this info in the CID.ini file or cidlog file.

__________________
Todd Hannemann

HA newbie

   PowerHome - UPB - ELK    
Back to Top View mustangcoupe's Profile Search for other posts by mustangcoupe Visit mustangcoupe's Homepage
 
BeachBum
Super User
Super User
Avatar

Joined: April 11 2007
Location: United States
Online Status: Offline
Posts: 1880
Posted: September 16 2008 at 22:09 | IP Logged Quote BeachBum

Todd, my code was not very clean but it was to test your scenario. Glad I was able to help.

__________________
Pete - X10 Oldie
Back to Top View BeachBum's Profile Search for other posts by BeachBum
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum