Giter Site home page Giter Site logo

jxmot / github-feeds Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.14 MB

This repository contains a "GitHub Feed" browser plug-in.

License: MIT License

HTML 19.07% CSS 20.05% JavaScript 48.01% Shell 4.66% PHP 8.21%
github-api jquery jquery-plugin widget

github-feeds's Introduction

jxmot

github-feeds's People

Contributors

jxmot avatar

Watchers

 avatar

github-feeds's Issues

Github repo description breaks jQuery

jQuery will crash when a github repository description contains any tag. For example:

A PHP script that reads an HTML file, finds all <link> and <script> tags. The local files that are referenced in those tags are concatenated into single CSS and JS files.

Will cause the crash, it's because that text will be embedded into HTML. And the $().html() that used for rendering will see them and try to resolve the tags.

It's unfortunate that jQuery does not provide any usable information. It only says Uncaught SyntaxError: Unexpected identifier.

Investigate data file problems

It seems that retrieving the JSON data locally (anti rate limiting) takes more time than getting the data directly from GitHub.

There is no obvious cause, but the delay is noticeable at 5 to ~15 seconds.

a) Try to find the cause, it's likely something strange on the server.
b) Try to determine where the slow down is happening, could be one or more of:

  • Getting the PHP file (gfapi/index.php)
  • Getting the JSON data file, one of them is about 360k. It should not matter.

Investigate Repository Topics

Investigate the worth and effort for:

  • Collecting repo.topics[] items into a master associative array. And use the topic text as the key and keep a "topic occurrence" count in each.
  • Create a function that returns the topic array

Fix renderMD()

The renderMD() function in utils.js needs the string.replace() calls fixed. They should be using regex to replace all occurrences or be changed to replaceAll().

Need to render markdown

Github accepts markdown formatting in issues, and renders on site. Add the ability to do this in the activity entries only.

  • determine if there is a minimal markdown to render:
    • back-ticks - convert to and sanitize any embedded html
    • convert "\n" to
    • convert "\r" to nothing
    • TBD

Replace Gists tab with...

Potential candidates:

  • Starred Repos - use https://api.github.com/users/{user}/starred?per_page=100, add data gather to CRON task
  • Following -
  • TBD

Github data pagination

It might be necessary to handle "paging" when getting responses from Github. This will not occur if the anti rate limiting feature is being used.

In regards to the bash scripts curl does not understand Github's pagination. Currently we can get only up to 100 repositories, beyond that won't be accessible.

If requests go direct to Github then pagination might be necessary.

// example
nextUrl = ajx.getAllResponseHeaders().match(/<(.*)>; rel="next"/);

Markdown render in repo comments bug

In /assets/js/util.js:renderMD() an error occurs with the backtick. In some cases the rendering gets confused and misses a backtick.

Observe how issue #20 displays the comments. The issue will be seen there.

Mobile Browser(all) Issues

  • light/dark switch is not visible, will need to move it.
  • Can't bust through the browsers' cache. The won't get new content even after it has changed on the server.

Improve "waiting for non-zero " code

index.php has this loop:

    // if the file is being updated its length
    // will be 0. What until the update is done.
    while(filesize($datafile) === 0) {
        sleep(3);
        clearstatcache();
        error_log('github-feeds: waiting for non-zero :'.$datafile,0);
    }
    $fileid = fopen($datafile,'r');

During certain GitHub API issues (responses are taking to much time) the file will remain at zero-length almost indefinitely. There needs to be a limitation on the loop so that it will generate an error w/o causing much disturbance to the client.

The zero-length file is created by the curl calls in the API scripts. This is because the curl command has its output captured and redirected to a file. That file is recreated each time so it's length will be zero until GitHub sends a response.

Repository Names

Investigate if repository names can contain spaces. If so then check all code that touches the repository name.

If issues are found fix them.

Repo activity is interpreted incorrectly

When a repo is starred (or forked?) then it will appear in [OWNER]repos.json. However there is nothing that the repository record contains that will indicate that either has occurred.

Fix "to top"

The "to top" button does not work correctly when there are 2 feeds (two usernames). This is because there is only one instance and the last "to top" button enabled will have precedence.

Add a dark theme

Using github-feed-default.css as a starting point create github-feed-dark.css and modify the colors for a "dark" theme.

  1. Add a "switch" in the feed header to select dark/light themes
  2. TBD

Filter repo events

Repositories that are low priority, or are old but receive occasional maintenance are showing in the list.

  • gfapi/index.php and gfapi/filter.php - add filterEvents(), it will operate identically to filterRepos(). This will limit events to only repos that are enabled in gfapi/filter.json.

Repo events fail to render

Some "PushEvent" events do not contain any event.payload.commits[]. This causes a failure due to an "undefined" when accessing a item in event.payload.commits[X].

  • github-feeds.js - in events() when event.type == "PushEvent" test event.payload.commits.length for 0 and do nothing if true.

Light/Dark switch icons

The light/dark switch icons (๐ŸŒž and ๐ŸŒœ) won't display on older(?) browsers.

Evaluate the effort of changing to something more "generic".

Mobile Browser(FireFox) Issues

The Firefox Android browser is a failure. Will need to add:

  • browser detection
  • adjustments to CSS based on the browser used.
  • TBD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.