Re: URL Checker

2014-04-30 Thread Scott Prentice
You got me thinking about this. Here's some really basic ExtendScript 
code that will iterate over all markers and check the text of message 
URL Hypertext markers to see if they are valid files (on the local file 
system). This would need to be cleaned up a bit to make it useful, but 
definitely doable ..


var doc = app.ActiveDoc;
var marker = doc.FirstMarkerInDoc;
while (marker.id) {
if (marker.MarkerTypeId.Name == Hypertext) {
var markerText = marker.MarkerText;
if (markerText.substr(0,11) == message URL) {
var target = markerText.substr(12);
// tests for local files
var file = File(target);
if (file.exists) {
Console(GOOD [+target+]);
} else {
Console(BAD [+target+]);
}
}
}
marker = marker.NextMarkerInDoc;
}

It turns out that you can test for remote (web-based) URLs using the 
Socket object.


Cheers,

...scott

On 4/29/14 5:55 PM, Scott Prentice wrote:

Hi John...

Interesting.

First, you'd have to define what it means for a link to be valid. 
Are these URLs to content on a web server? If so, does valid mean that 
it doesn't return a 404 error (page not found)? Or do you need to know 
that the page actually has the content that you expected it to .. in 
which case you might want to be able to scan the content at the target 
URL for text that matches the link text?


Or .. am I blowing this out of proportion, and you're just looking on 
a local file system for a matching file name?


If the latter, ExtendScript should be able to do what you need, if the 
former, you might need a bit more processing power like an FDK client.


I'll be interested to see if anyone else has done this sort of thing.

If you need help developing such a script/utility .. give me a holler.

Cheers,

...scott

Scott Prentice
Leximation, Inc.
www.leximation.com
+1.415.485.1892


On 4/28/14 12:11 PM, john.x.pos...@us.hsbc.com wrote:

Hi, guys...FM 11.

I have a section in my books that is just pages and pages of links to text,
sql, excel, and PDF files that are out on our Sharepoint system.

As we go forward, the links are becoming a maintenance issue. While I know
I cannot automate the creation of the links, I'd like to have something
that can validate my links.

Each link is defined as a Go to URL hyperlink and it is an absolute link,
not relative.

Has anyone done this kind of scripting?

Thanks

John X Posada
AML Syst  Ops Supt Data Analyst | US FCC  RC Systems Control  Analytics
| HSBC North America Holdings Inc
330 Madison Ave., NY NY
  
  ___
  
  
  
  
  
  Phone

   Int: 212-525-5483 Ext: Personal cellphone - 732-259-2874
  Mobile
   Company Blackberry - 224-600-0570
  Email
   john.x.pos...@us.hsbc.com   
  
  ___

  Protect our environment - please only print this if you have
  to!
  




-
**
This E-mail is confidential. It may also be legally privileged. If
you are not the addressee you may not copy, forward, disclose or
use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return E-mail.

Internet communications cannot be guaranteed to be timely, secure,
error or virus-free. The sender does not accept liability for any
errors or omissions.
**
SAVE PAPER - THINK BEFORE YOU PRINT!
___






___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


Re: URL Checker

2014-04-30 Thread russ
John and Scott (and Rick),

I have a sample ExtendScript that uses the Socket object, called
NETWORK_-_Retrieve_text_over_network.jsx. It retrieves text from a
webpage and sticks it into a document. It could be easily modified to
just look for the 200 OK message. All in all, this would be a very short
and generally simple script for an experienced developer. A great idea
for a script, really. I should add it to the group. I could use it
myself.

http://www.weststreetconsulting.com/WSC_ExtendScriptSamples.htm

Russ




--

Message: 16
Date: Wed, 30 Apr 2014 09:46:55 -0700
From: Scott Prentice s...@leximation.com
To: john.x.pos...@us.hsbc.com, framers 
Subject: Re: URL Checker
Message-ID: 536128ff.2060...@leximation.com
Content-Type: text/plain; charset=iso-8859-1; Format=flowed

You got me thinking about this. Here's some really basic ExtendScript 
code that will iterate over all markers and check the text of message 
URL Hypertext markers to see if they are valid files (on the local file

system). This would need to be cleaned up a bit to make it useful, but 
definitely doable ..

var doc = app.ActiveDoc;
var marker = doc.FirstMarkerInDoc;
while (marker.id) {
 if (marker.MarkerTypeId.Name == Hypertext) {
 var markerText = marker.MarkerText;
 if (markerText.substr(0,11) == message URL) {
 var target = markerText.substr(12);
 // tests for local files
 var file = File(target);
 if (file.exists) {
 Console(GOOD [+target+]);
 } else {
 Console(BAD [+target+]);
 }
 }
 }
 marker = marker.NextMarkerInDoc;
}

It turns out that you can test for remote (web-based) URLs using the 
Socket object.

Cheers,

...scott


___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


RE: URL Checker

2014-04-30 Thread Rick Quatro
Hi Russ,

Thanks for including me in your response. I wasn't aware of the Socket
object, but I just tried your script and it works great! This opens up
possibilities for some interesting applications. Thanks again.

Rick Quatro
Carmen Publishing Inc.
585-366-4017
r...@frameexpert.com




-Original Message-
From: framers-boun...@lists.frameusers.com
[mailto:framers-boun...@lists.frameusers.com] On Behalf Of
r...@weststreetconsulting.com
Sent: Wednesday, April 30, 2014 3:30 PM
To: framers@lists.frameusers.com
Subject: Re: URL Checker

John and Scott (and Rick),

I have a sample ExtendScript that uses the Socket object, called
NETWORK_-_Retrieve_text_over_network.jsx. It retrieves text from a webpage
and sticks it into a document. It could be easily modified to just look for
the 200 OK message. All in all, this would be a very short and generally
simple script for an experienced developer. A great idea for a script,
really. I should add it to the group. I could use it myself.

http://www.weststreetconsulting.com/WSC_ExtendScriptSamples.htm

Russ




--

Message: 16
Date: Wed, 30 Apr 2014 09:46:55 -0700
From: Scott Prentice s...@leximation.com
To: john.x.pos...@us.hsbc.com, framers
Subject: Re: URL Checker
Message-ID: 536128ff.2060...@leximation.com
Content-Type: text/plain; charset=iso-8859-1; Format=flowed

You got me thinking about this. Here's some really basic ExtendScript code
that will iterate over all markers and check the text of message URL
Hypertext markers to see if they are valid files (on the local file

system). This would need to be cleaned up a bit to make it useful, but
definitely doable ..

var doc = app.ActiveDoc;
var marker = doc.FirstMarkerInDoc;
while (marker.id) {
 if (marker.MarkerTypeId.Name == Hypertext) {  var markerText =
marker.MarkerText;  if (markerText.substr(0,11) == message URL) {  var
target = markerText.substr(12);  // tests for local files  var file =
File(target);  if (file.exists) {  Console(GOOD [+target+]);  } else {
Console(BAD [+target+]);  }  }  }  marker = marker.NextMarkerInDoc; }

It turns out that you can test for remote (web-based) URLs using the Socket
object.

Cheers,

...scott


___


You are currently subscribed to framers as r...@rickquatro.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit
http://lists.frameusers.com/mailman/options/framers/rick%40rickquatro.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.

___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


Re: URL Checker

2014-04-29 Thread Scott Prentice

Hi John...

Interesting.

First, you'd have to define what it means for a link to be valid. Are 
these URLs to content on a web server? If so, does valid mean that it 
doesn't return a 404 error (page not found)? Or do you need to know that 
the page actually has the content that you expected it to .. in which 
case you might want to be able to scan the content at the target URL for 
text that matches the link text?


Or .. am I blowing this out of proportion, and you're just looking on a 
local file system for a matching file name?


If the latter, ExtendScript should be able to do what you need, if the 
former, you might need a bit more processing power like an FDK client.


I'll be interested to see if anyone else has done this sort of thing.

If you need help developing such a script/utility .. give me a holler.

Cheers,

...scott

Scott Prentice
Leximation, Inc.
www.leximation.com
+1.415.485.1892


On 4/28/14 12:11 PM, john.x.pos...@us.hsbc.com wrote:

Hi, guys...FM 11.

I have a section in my books that is just pages and pages of links to text,
sql, excel, and PDF files that are out on our Sharepoint system.

As we go forward, the links are becoming a maintenance issue. While I know
I cannot automate the creation of the links, I'd like to have something
that can validate my links.

Each link is defined as a Go to URL hyperlink and it is an absolute link,
not relative.

Has anyone done this kind of scripting?

Thanks

John X Posada
AML Syst  Ops Supt Data Analyst | US FCC  RC Systems Control  Analytics
| HSBC North America Holdings Inc
330 Madison Ave., NY NY
  
  ___
  
  
  
  
  
  Phone

   Int: 212-525-5483 Ext: Personal cellphone - 732-259-2874
  Mobile
   Company Blackberry - 224-600-0570
  Email
   john.x.pos...@us.hsbc.com
  
  ___

  Protect our environment - please only print this if you have
  to!
  




-
**
This E-mail is confidential. It may also be legally privileged. If
you are not the addressee you may not copy, forward, disclose or
use any part of it. If you have received this message in error,
please delete it and all copies from your system and notify the
sender immediately by return E-mail.

Internet communications cannot be guaranteed to be timely, secure,
error or virus-free. The sender does not accept liability for any
errors or omissions.
**
SAVE PAPER - THINK BEFORE YOU PRINT!
___




___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.


RE: URL Checker

2014-04-29 Thread Rick Quatro
Hi John,

I did something like this for a client with FrameScript. I used the
Msxml2.ServerXMLHTTP.4.0 object built into MSXML 4.0 (Microsoft's free XML
parser) to send a GET request to each URL. If I got a 200 returned, the
link was OK; a 404 told me that the link was incorrect. I think I used the
Book Error Log to report the bad links.

Since Sharepoint is browser-based (I think), this type of script may work
for you. If you are interested, please let me know and we can try some
tests.

I am not sure this will work with ExtendScript, because there is no ActiveX
interface like there is with FrameScript.

Rick

Rick Quatro
Carmen Publishing Inc.
585-366-4017
r...@frameexpert.com



-Original Message-
From: framers-boun...@lists.frameusers.com
[mailto:framers-boun...@lists.frameusers.com] On Behalf Of
john.x.pos...@us.hsbc.com
Sent: Monday, April 28, 2014 3:11 PM
To: framers
Subject: URL Checker

Hi, guys...FM 11.

I have a section in my books that is just pages and pages of links to text,
sql, excel, and PDF files that are out on our Sharepoint system.

As we go forward, the links are becoming a maintenance issue. While I know I
cannot automate the creation of the links, I'd like to have something that
can validate my links.

Each link is defined as a Go to URL hyperlink and it is an absolute link,
not relative.

Has anyone done this kind of scripting?

Thanks

John X Posada
AML Syst  Ops Supt Data Analyst | US FCC  RC Systems Control  Analytics
| HSBC North America Holdings Inc
330 Madison Ave., NY NY
 
 ___ 
 
 
 
 
 
 Phone   
  Int: 212-525-5483 Ext: Personal cellphone - 732-259-2874   
 Mobile  
  Company Blackberry - 224-600-0570  
 Email   
  john.x.pos...@us.hsbc.com  
 
 ___ 
 Protect our environment - please only print this if you have
 to! 
 



-
**
This E-mail is confidential. It may also be legally privileged. If you are
not the addressee you may not copy, forward, disclose or use any part of it.
If you have received this message in error, please delete it and all copies
from your system and notify the sender immediately by return E-mail.

Internet communications cannot be guaranteed to be timely, secure, error or
virus-free. The sender does not accept liability for any errors or
omissions.
**
SAVE PAPER - THINK BEFORE YOU PRINT!
___


You are currently subscribed to framers as r...@rickquatro.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit
http://lists.frameusers.com/mailman/options/framers/rick%40rickquatro.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.

___


You are currently subscribed to framers as arch...@mail-archive.com.

Send list messages to framers@lists.frameusers.com.

To unsubscribe send a blank email to
framers-unsubscr...@lists.frameusers.com
or visit 
http://lists.frameusers.com/mailman/options/framers/archive%40mail-archive.com

Send administrative questions to listad...@frameusers.com. Visit
http://www.frameusers.com/ for more resources and info.