⌈⌋ branch:  freshcode


Check-in [eecd325303]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add fossforce, remove xyz-apps.org (dead for good?, albeit kde had a similar app store now)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1: eecd325303216f7a32310acfbcd45a4716c5bf68
User & Date: mario 2021-12-26 18:13:38
Context
2021-12-26
18:13
Add fossforce, remove xyz-apps.org (dead for good?, albeit kde had a similar app store now) Leaf check-in: eecd325303 user: mario tags: trunk
2021-12-21
13:49
Logging function for submit failures check-in: d7b8c7f2f3 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to cron.daily/news_feeds.php.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
<?php
/**
 * title: Article feeds
 * description: Queries a few online resources for article links
 * version: 0.5
 * category: template
 * api: cli
 * type: cron
 * x-cron: 12 *\/4 * * * 
 *
 * Highlights version numbers in news feeds,
 * and populates templates/feed.*.htm for sidebar display.
 *
 * Some of the collected entries (*games) are displayed togerther in sidebar blocks.
 *
 */


// switch to webroot
chdir(dirname(__DIR__));


#-- RSS
$feeds = array(
    "linuxcom,7" => "http://www.linux.com/news/software?format=feed&type=rss",
    "reddit,17" => "http://www.reddit.com/r/linux/.rss",

    "linuxgames,5" => "http://www.linuxgames.com/feed",
    "gamingonlinux,4" => "http://www.gamingonlinux.com/article_rss.php",
    "linuxgamenews,3" => "http://linuxgamenews.com/rss",
    "freegamer,3" => "http://freegamer.blogspot.com/feeds/posts/default?alt=rss",
    "sourceforge,22" => "http://sourceforge.net/directory/release_feed/",
    "distrowatch,15" => "http://distrowatch.com/news/dwd.xml",
    "beopen,7" => "http://beopen.bplaced.net/category/projects/feed/",
    "gtkapps,5" => "http://gtk-apps.org/gtk-apps-content.rdf",
    "kdeapps,5" => "http://www.kde.org/dot/kde-apps-content.rdf",
    "qtapps,4" => "http://qt-apps.org/qt-apps-content.rdf",
    "cliapps,3" => "http://cli-apps.org/cli-apps-content.rdf",
);
$filter = 
    "/Please 'report' off-topic|namelessrom|machomebrew/"
;
$seen = array();

#-- Traverse and collect entries
foreach ($feeds as $name=>$url) {

    // data
    list($name, $max) = str_getcsv($name);

    $output = "";
    $x = file_get_contents($url);
    $x = preg_replace("/[^\x20-\x7F\s]/", "", $x);
    $x = simplexml_load_string($x);
    
    // append
    $i = 0;




|



















|

>







|
|
|
|











>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
 * title: Article feeds
 * description: Queries a few online resources for article links
 * version: 0.6
 * category: template
 * api: cli
 * type: cron
 * x-cron: 12 *\/4 * * * 
 *
 * Highlights version numbers in news feeds,
 * and populates templates/feed.*.htm for sidebar display.
 *
 * Some of the collected entries (*games) are displayed togerther in sidebar blocks.
 *
 */


// switch to webroot
chdir(dirname(__DIR__));


#-- RSS
$feeds = array(
    "linuxcom,7" => "https://www.linux.com/feed/", #"http://www.linux.com/news/software?format=feed&type=rss",
    "reddit,17" => "http://www.reddit.com/r/linux/.rss",
    "fossforce,7" => "http://fossforce.com/feed/",
    "linuxgames,5" => "http://www.linuxgames.com/feed",
    "gamingonlinux,4" => "http://www.gamingonlinux.com/article_rss.php",
    "linuxgamenews,3" => "http://linuxgamenews.com/rss",
    "freegamer,3" => "http://freegamer.blogspot.com/feeds/posts/default?alt=rss",
    "sourceforge,22" => "http://sourceforge.net/directory/release_feed/",
    "distrowatch,15" => "http://distrowatch.com/news/dwd.xml",
    "beopen,7" => "http://beopen.bplaced.net/category/projects/feed/",
#    "gtkapps,5" => "http://gtk-apps.org/gtk-apps-content.rdf",
#    "kdeapps,5" => "http://www.kde.org/dot/kde-apps-content.rdf",
#    "qtapps,4" => "http://qt-apps.org/qt-apps-content.rdf",
#    "cliapps,3" => "http://cli-apps.org/cli-apps-content.rdf",
);
$filter = 
    "/Please 'report' off-topic|namelessrom|machomebrew/"
;
$seen = array();

#-- Traverse and collect entries
foreach ($feeds as $name=>$url) {

    // data
    list($name, $max) = str_getcsv($name);
    print "=== $name ($url) ===\n";
    $output = "";
    $x = file_get_contents($url);
    $x = preg_replace("/[^\x20-\x7F\s]/", "", $x);
    $x = simplexml_load_string($x);
    
    // append
    $i = 0;
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
        # per feed
        switch ($name) {

            // Extract project base names and version numbers
            case "sourceforge":
                if (preg_match("~^(http://sourceforge.net/projects/(\w+))/files/.+?(\d+(\.\d+)+([-_. ](rc|beta|alpha|dev)([-._]?\d[.\d]*)?)?).+?/download$~", urldecode($item->link), $m)) {
                    if (in_array($m[1], $seen)) {
                        continue;
                    }
                    else {
                        $seen[] = $m[1];
                    }
                    $output .= "<a class=\"feed-$name\" href=\"$m[1]\">$m[2] <em>$m[3]</em></a>\n";
                    $i++;
                }







|







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
        # per feed
        switch ($name) {

            // Extract project base names and version numbers
            case "sourceforge":
                if (preg_match("~^(http://sourceforge.net/projects/(\w+))/files/.+?(\d+(\.\d+)+([-_. ](rc|beta|alpha|dev)([-._]?\d[.\d]*)?)?).+?/download$~", urldecode($item->link), $m)) {
                    if (in_array($m[1], $seen)) {
                        continue 2;
                    }
                    else {
                        $seen[] = $m[1];
                    }
                    $output .= "<a class=\"feed-$name\" href=\"$m[1]\">$m[2] <em>$m[3]</em></a>\n";
                    $i++;
                }
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

            // Titles as is
            default:
            case "reddit":
            case "linuxcom":
            case "linuxgames":
                if (strlen($item->link) and strlen($item->title)) {
                    $title = preg_replace("~(\d+\.[\d-.]+)~", "<em>$0</em>", $title);
                    $output .="<a class=\"feed-$name\" href=\"$link\">$title</a>\n";
                    $i++;
                }
                break;
        }

        if ($i >= $max) { break; }







|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

            // Titles as is
            default:
            case "reddit":
            case "linuxcom":
            case "linuxgames":
                if (strlen($item->link) and strlen($item->title)) {
                    $title = preg_replace("~(\d+\.[\d\-.]+)~", "<em>$0</em>", $title);
                    $output .="<a class=\"feed-$name\" href=\"$link\">$title</a>\n";
                    $i++;
                }
                break;
        }

        if ($i >= $max) { break; }

Changes to template/index_sidebar.php.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31





32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
?>

<!--aside-->
<td id=sidebar valign=top>

    <section class="article-links untrimmed feed-fossies">
        <a href="http://fossies.org/"><h5><span class=green>Fossies</span>.org <small class=blue>/misc</small></h5></a>
        <?  readfile("template/feed.fossies.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>reddit<em>/r/linux</em></h5>
        <?  readfile("template/feed.reddit.htm");  ?>
    </section>

    <section class="article-links untrimmed">
        <h5>DistroWatch</h5>
        <?  readfile("template/feed.distrowatch.htm");  ?>





    </section>

    <section class="article-links trimmed">
        <h5>Games <a href="http://www.linuxgames.com/" style=display:inline>LG</a>, <a href="http://www.gamingonlinux.com/" style=display:inline>GoL</a>, <a href="http://freegamer.blogspot.com/" style=display:inline>FG</a></h5>
        <?  readfile("template/feed.gamingonlinux.htm");  ?>
        <?  readfile("template/feed.linuxgames.htm");  ?>
        <?  readfile("template/feed.linuxgamenews.htm");  ?>
        <?  readfile("template/feed.freegamer.htm");  ?>
    </section>

    <section class="article-links untrimmed">
        <h5>Sourceforge Files</h5>
        <?  readfile("template/feed.sourceforge.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>beOpen</h5>
        <?  readfile("template/feed.beopen.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>openDesktop</h5>
        <?  readfile("template/feed.gtkapps.htm");  ?>
        <?  readfile("template/feed.kdeapps.htm");  ?>
        <?  readfile("template/feed.qtapps.htm");  ?>
        <?  readfile("template/feed.cliapps.htm");  ?>
    </section>

    <section class="article-links" style="max-width: 220px; overflow: hidden;">
        <a href="/github-releases"><h5>GitHub releases →</h5></a>
        <?  readfile("template/feed.github.htm");  ?>
    </section>

    <section class="article-links">
        <a href="/launchpad-releases"><h5>LaunchPad news →</h5></a>
        <?  readfile("template/feed.launchpad.htm");  ?>
    </section>

</td>
<!--/aside-->







|




|




|
>
>
>
>
>




|
|
|
|




|




|
<
<
<
<
<
<
<
<




|




|




14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54








55
56
57
58
59
60
61
62
63
64
65
66
67
68
?>

<!--aside-->
<td id=sidebar valign=top>

    <section class="article-links untrimmed feed-fossies">
        <a href="http://fossies.org/"><h5><span class=green>Fossies</span>.org <small class=blue>/misc</small></h5></a>
        <?php  readfile("template/feed.fossies.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>reddit<em>/r/linux</em></h5>
        <?php  readfile("template/feed.reddit.htm");  ?>
    </section>

    <section class="article-links untrimmed">
        <h5>DistroWatch</h5>
        <?php  readfile("template/feed.distrowatch.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5><em>foss</em>force</h5>
        <?php  readfile("template/feed.fossforce.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>Games <a href="http://www.linuxgames.com/" style=display:inline>LG</a>, <a href="http://www.gamingonlinux.com/" style=display:inline>GoL</a>, <a href="http://freegamer.blogspot.com/" style=display:inline>FG</a></h5>
        <?php  readfile("template/feed.gamingonlinux.htm");  ?>
        <?php  readfile("template/feed.linuxgames.htm");  ?>
        <?php  readfile("template/feed.linuxgamenews.htm");  ?>
        <?php  readfile("template/feed.freegamer.htm");  ?>
    </section>

    <section class="article-links untrimmed">
        <h5>Sourceforge Files</h5>
        <?php  readfile("template/feed.sourceforge.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>beOpen</h5>
        <?php  readfile("template/feed.beopen.htm");  ?>








    </section>

    <section class="article-links" style="max-width: 220px; overflow: hidden;">
        <a href="/github-releases"><h5>GitHub releases →</h5></a>
        <?php  readfile("template/feed.github.htm");  ?>
    </section>

    <section class="article-links">
        <a href="/launchpad-releases"><h5>LaunchPad news →</h5></a>
        <?php  readfile("template/feed.launchpad.htm");  ?>
    </section>

</td>
<!--/aside-->