Forum is preventing me of posting an twitter profile example, so replace "twitter" with the any twitter profile
Code: Select all
on mouseUp
put URL "twitter" into field Logs
put empty into field Tweets
put "<span class=" & quote & "entry-content" & quote & ">" into myExpression
repeat for each line thisLine in field Logs
if myExpression is in thisLine then
put word 1 to -1 of thisLine into thisLine
replace myExpression with empty in thisLine
replace "</span>" with empty in thisLine
replace "</a>" with empty in thisLine
replaceText (thisLine,"<a\sclass=(.*)>",empty)
put thisLine & cr after field Tweets
end if
end repeat
end mouseUp
Problem is matchText and replaceText are firing a Handler can't find handler error.
Since matchText was firing the same error, I changed the code and add all the cleaning statements plus the replaceText function
This line
Code: Select all
replaceText (thisLine,"<a\sclass=(.*)>",empty)
Code: Select all
replaceText (thisLine,"<a class=(.*)>",empty)
The ideal thing was to use the matchText function, extracting the data I want with a regular expression. When used it triggered the same error.