I look forward to hearing from you!
 
 I'm using livecode version 6.5
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
 
 shall we send some money or what?Whytey wrote:...most curious please help.
 
  
 Code: Select all
command searchForums
   set the htmlText of field "Results2" to URL ("http://www.ncbi.nlm.nih.gov/pubmed/?term=" & urlEncode(the text of field Search))
end searchForums 
 Code: Select all
put "http://www.ncbi.nlm.nih.gov/pubmed/?term=" & urlEncode(the text of field Search) into tURL
answer "URL is:" && tURL -- just to be sure it's right
put url tURL into tData
answer "Result is:" && the result
answer "Data is:" && tDataCode: Select all
put URL ("http://www.ncbi.nlm.nih.gov/pubmed/?term=" & urlEncode(the text of field Search)) into tData
if the result is not empty then -- error
  answer the result
else
  set the htmltext of fld "results2" to tData
end ifCode: Select all
command searchForums
put "http://www.ncbi.nlm.nih.gov/pubmed/?term=" & urlEncode(the text of field Search) into tURL
answer "URL is:" && tURL -- just to be sure it's right
put url tURL into tData
answer "Result is:" && the result
answer "Data is:" && tData
end searchForumsCode: Select all
on mouseUp
   searchForums 
  put fld "Results2" into tText
    put wordoffset("Results:",tText) into tStart
    put wordoffset("[Pubmed]",tText) into tEnd
    put word tStart to tEnd of tText into fld "Box1"
    put line 1 to "10" of fld "Box1" into fld "BoxA" of card "test"
    put line "11" to "22" of fld "Box1" into fld "BoxB" of card "test"
    put line 23 to 33 of fld "Box1" into fld "BoxC" of card "test"
    go card "test"
    end mouseUp
command searchForums
set the htmlText of field "Results2" to URL ("http://www.ncbi.nlm.nih.gov/pubmed/?term=" & urlEncode(the text of field Search)) 
end searchForums
 
 
Code: Select all
on mouseUp
   searchForums 
   put fld "Results2" into tText
   answer "Data is:" && tText
end mouseUp
command searchForums
set the htmlText of field "Results2" to URL ("http://www.ncbi.nlm.nih.gov/pubmed/?term=" & urlEncode(the text of field Search)) 
end searchForumsHi Whytey,Whytey wrote:I can get a nice list of papers coming down on my tablet as well as on the computer so doesn't seem to be an internet problem rather a parsing problem. I now need to find a way to parse the top five entries in the tText, any ideas?
This is exactly what the tText box that comes up looks like on my tablet (all entries now come up)
Biologically Based Therapy for the Intervertebral Disk: Who Is the Patient?
Erwin WM, et al. Global Spine J. 2013
.....
Code: Select all
on Doit
   put fld 1 into Txtsource -- search text result
   put empty into  fld 2 -- 5 splitted first entries
   
   -- need to get rid of the first lines
   -- let this as an exercice to you as I don't know
   -- what are the common lines from different searchs
   
   -- I assume the above works
   -- the 1st line then is : Biologically Based Therapy.....
   
   repeat with i=1 to 5
      -- from the start of the text, look for any number of lines
      -- with the end of last line finishing by a 4 digits
      -- followed or not by a dot and may be some extra space before the return
      if matchChunk( Txtsource, "(?ms)^(.*?\d{4}\.?\s*\n)",pS,pE) then
         put char pS to pE of Txtsource into pubMedEntry
         delete char pS to pE of Txtsource
         put "------ N" &i &cr& pubMedEntry after fld 2
      else
         answer "Sorry, not 5 five entries"
         exit repeat
      end if
   end repeat
end Doit 
   
   !! So on the laptop you get a whole stream of junk text coming down with the entries but when I entered your code Jacque to test everything was working ok, I found things looked a lot neater and more organised on the tablet and mobile. So like you suggested Thierry I deleted the first 7 lines and after fiddling around (and trying to learn a little about Regex so I could understand your complicated code Thierry!) it seemed that each entry coming down on the tablet was actually on a single line (amazing!!) so once I realised that it was pretty simple to sort into the boxes no complicated parsing needed!! Simon, Klaus thank you so much for your suggestions I've learnt a huge amount on livecode from you all and I know I'm gonna need your codes in the future!! Super happy!!
 !! So on the laptop you get a whole stream of junk text coming down with the entries but when I entered your code Jacque to test everything was working ok, I found things looked a lot neater and more organised on the tablet and mobile. So like you suggested Thierry I deleted the first 7 lines and after fiddling around (and trying to learn a little about Regex so I could understand your complicated code Thierry!) it seemed that each entry coming down on the tablet was actually on a single line (amazing!!) so once I realised that it was pretty simple to sort into the boxes no complicated parsing needed!! Simon, Klaus thank you so much for your suggestions I've learnt a huge amount on livecode from you all and I know I'm gonna need your codes in the future!! Super happy!!  
