Tool to parse Pagescope Web Connection?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • widardd
    Junior Member
    • May 2023
    • 1

    #1

    Tool to parse Pagescope Web Connection?

    Hey there,

    working with Konica Minolta C6100, C7100 and C6361 for about a year now and I need a way to get notified the moment there's a problem.

    For the C7100 and the C6361 I realized there's publicly accessible JSON available at http://xxx.xxx.xxx.xxx:30083/productionData.fcgi.

    My limited c# skills were enough to write a little application that uses a telegram bot to notify me the moment one of these printers has an issue.

    But, the C6100, for whatever reason, is not running AccurioPro, so that JSON file is missing and I'm left with Pagescope Web Connection to parse the status.

    That's too complicated for my limited skills as it requires logging in and even got a time out.

    I tried to do some research wether there's a library or tool someone wrote for this purpose, but I couldn't find anything.

    So I figured someone on here must have been in my shoes at some point and maybe either found or created a tool/library/etc. to help with that.

    Thank you very much!
  • slimslob
    Retired

    Site Contributor
    25,000+ Posts
    • May 2013
    • 36242

    #2
    Re: Tool to parse Pagescope Web Connection?

    Post in the KM technical forum. I am sure there are KM techs that know of a KM app that will do what you want or at least a setting to send automatic email alerts from the machines. Or at least Ricoh does.

    Comment

    • techsxge
      Senior Tech

      Site Contributor
      500+ Posts
      • Jan 2022
      • 661

      #3
      Re: Tool to parse Pagescope Web Connection?

      CLASS:










      namespace System.Net
      {
      using System.Collections.Specialized;
      using System.Linq;
      using System.Text;


      public class CookieAwareWebClient : WebClient
      {
      public void Login(string loginPageAddress, NameValueCollection loginData)
      {
      CookieContainer container;


      var request = (HttpWebRequest)WebRequest.Create(loginPageAddress );


      request.Method = "POST";
      request.ContentType = "application/x-www-form-urlencoded";


      var query = string.Join("&",
      loginData.Cast<string>().Select(key => $"{key}={loginData[key]}"));


      var buffer = Encoding.ASCII.GetBytes(query);
      request.ContentLength = buffer.Length;
      var requestStream = request.GetRequestStream();
      requestStream.Write(buffer, 0, buffer.Length);
      requestStream.Close();


      container = request.CookieContainer = new CookieContainer();


      var response = request.GetResponse();
      response.Close();
      CookieContainer = container;
      }


      public CookieAwareWebClient(CookieContainer container)
      {
      CookieContainer = container;
      }


      public CookieAwareWebClient()
      : this(new CookieContainer())
      { }


      public CookieContainer CookieContainer { get; private set; }


      protected override WebRequest GetWebRequest(Uri address)
      {
      var request = (HttpWebRequest)base.GetWebRequest(address);
      request.CookieContainer = CookieContainer;
      return request;
      }
      }
      }




      USAGE:




      public static void Main()
      {
      var loginAddress = "http://xxx.xxx.xxx.xxx:xxxx/xxxx";
      var loginData = new NameValueCollection
      {
      { "username", "admin" },
      { "password", "myadminpassword" }
      };


      var client = new CookieAwareWebClient();
      client.Login(loginAddress, loginData);
      }



      This will allow you to login to the current site. Please not that if you are on a html site you will not be able to store credentials for long but could use the cookie to go further into the menus
      Last edited by techsxge; 05-11-2023, 12:03 PM. Reason: Code Tags will fuck up the entire post

      Comment

      Working...