On 19.12.2022 19:23, P.O. Jonsson wrote:
Would it be much work to indicate who created the bug report/rfe ? I guess I can look at my own at sourceforge but it would be convenient to have

It is work and unfortunately my time buffers are vaporizing a little bit.

In principle everything that is listed and can be parsed from <https://sourceforge.net/p/oorexx/feature-requests/> can be incorporated. However, CHANGES is a brief, scarce text file and does not have too much space, hence having too much of information will make it unreadable.

Enclosed a coarsely cleansed version of the (quick & dirty) script (needing maybe a little bit more documentation) that can be changed/edited as much as the heart wants it too! ;)

Of course, one needs ooRexx 5.0.0 to run it :) (and only tested on Windows at the moment but should work on Unixes as well).

---rony
pkgLocal=.context~package~local
pkgLocal~null.Dev=.nullDevice~new

ticketTypes="bugs","feature-requests","documentation","patches"
pkgLocal~shortNames=.stringTable~of(("bugs"            ,"BUG"), -
                                    ("feature-requests","RFE"), -
                                    ("documentation"   ,"DOC"), -
                                    ("patches"         ,"PAT"))
proj   ="p/oorexx/"
host   ="https://sourceforge.net/";
query  ="/search/?q=status%3Aaccepted+or+status%3Apending"

outArr=.array~new    -- array for result

do label types counter c1 t over ticketTypes
   resArr=.array~new
   say c1"." pp(t)
   cmd=host || proj || t || query
   address system "curl -L" cmd with output using (outArr) error using (.null.dev)
   str=outArr~makeString

   parse var str '<div class="page_list">' '<a href' '</a>' '<a href="' nextPageUrl '"' '(' . firstPage . lastPage ')' '</div>'
   currPage=1
   needle='<td><a href="/'proj || t
   do label group counter c2 while str<>""
      parse var str (needle)  '/">'    nr      '</a></td>'  -
                    (needle)  '/">'    summary '</a></td>'  -
                    '<td class="closed">' status '</td>'      str

      if nr="" then  -- no more entries, read next page, if any
      do
          currPage+=1
          if currPage>lastPage then leave group
          cmdPage=quote(cmd || "&page=" || (currPage-1))  -- 0-based pages
          address system "curl -L" cmdPage with output using (outArr) error using (.null.dev)
          str=outArr~makeString
          iterate group
      end
      summary=unEsc(summary)
      resArr~append(.ticket~new(t,nr,summary,status))
   end
   resArr=resArr~sort
   say
   say "sorted:"
   do counter c3 i over resArr
      say c3~right(4)":" i
   end
   say "-*-*"~copies(25)
   say
end

/* ************************************************************************* */
::routine pp
  return "["arg(1)"]"

/* ************************************************************************* */
::routine unEsc
  parse arg val
  val=val~strip
  mb=.mutableBuffer~new
  do while val<>""
    parse var val before "&#" dec ";" val
    if before \=="" then mb~append(before)
    if dec<>"" then mb~append(dec~d2c) -- unescape
  end
  if val<>"" then mb~append(val)
  return mb~string


/* ************************************************************************* */
::class     ticket
::attribute nr
::attribute summary
::attribute status
::attribute type

::method init
  expose nr summary status type
  use arg type, nr, summary, status


::method compareTo_NrAsc
  expose type nr summary status
  use arg other
   -- by type ascendingly
  if type<other~type then return -1
  if type>other~type then return  1

  -- equal, now by nr ascendingly
  return nr-other~nr

::method compareTo
  expose type nr summary status
  use arg other
   -- by type ascendingly
  if type<other~type then return -1
  if type>other~type then return  1

  -- equal, now by nr descendingly
  return -(nr-other~nr)    -- invert


::method makeString
 expose type nr summary status
 -- return "a Ticket"pp("type="type",nr="nr",status="status",summary="summary)
 return .shortNames[type] "#" nr~right(4) summary


/* ************************************************************************* */
::class "NullDevice" subclass InputOutputStream
-- InputStream
::method charIn         unguarded   -- implement abstract method
   raise notReady
::method chars          unguarded   -- implement abstract method
   raise notReady
::method lineIn         unguarded   -- implement abstract method
   raise notReady
::method lines          unguarded   -- implement abstract method
   raise notReady

-- OutputStream
::method say            unguarded
::method lineOut        unguarded   -- implement abstract method
::method charOut        unguarded   -- implement abstract method


/* ************************************************************************* */
::routine quote
  return '"'arg(1)'"'
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to