Skip to content

Commit 598f82e

Browse files
authored
Adding feeds and api endpoints for jobs and membership counts (USRSE#730)
* adding feeds and api endpoints for jobs and membership counts Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 70f8a90 commit 598f82e

File tree

6 files changed

+69
-1
lines changed

6 files changed

+69
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ For each RSS feed, we provide the latest 100 items.
545545
- [https://us-rse.org/feeds/events.xml](https://us-rse.org/feeds/events.xml): subscribe to US-RSE events, including descriptions, locations, times, publication date, and categories (e.g., working groups or content types).
546546
- [https://us-rse.org/feeds/newsletters.xml](https://us-rse.org/feeds/newsletters.xml): subscribe to a subset of newsletter posts
547547
- [https://us-rse.org/feeds/dei.xml](https://us-rse.org/feeds/del.xml): subscribe to DEI working group events
548+
- [https://us-rse.org/feeds/jobs.xml](https://us-rse.org/feeds/jobs.xml): subscribe to latest non-expired jobs
549+
- [https://us-rse.org/feeds/member-counts.xml](https://us-rse.org/feeds/member-counts.xml): subscribe to monthly member total counts
548550

549551
### Json Feeds:
550552

@@ -554,6 +556,8 @@ JSON feeds are not limited in number, and we can provide this until a single pag
554556
- [https://us-rse.org/api/events.json](https://us-rse.org/api/events.json): json list of US-RSE events
555557
- [https://us-rse.org/api/newsletters.json](https://us-rse.org/api/posts.json): json list of US-RSE newsletters
556558
- [https://us-rse.org/api/dei.json](https://us-rse.org/api/dei.json): json list of dei events
559+
- [https://us-rse.org/api/jobs.json](https://us-rse.org/api/jobs.json): json list of non-expired jobs
560+
- [https://us-rse.org/api/member-counts.json](https://us-rse.org/api/member-counts.json): json list of monthly membership total count
557561

558562
## Thanks
559563

pages/api/jobs.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
layout: none
3+
permalink: /api/jobs.json
4+
---
5+
{% assign sorted_jobs = site.data.jobs | sort: "posted" | reverse %}[{% for job in sorted_jobs %}{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %}{% capture expires %}{{ job.expires | date: '%s'}}{% endcapture %}{% capture posted %}{{ job.posted | date: '%b %d, %Y'}}{% endcapture %}{% if expires > nowunix %}{
6+
"title": {{ job.name | jsonify }},
7+
{% if posted != '' %}"published": "{{ posted }}",{% endif %}
8+
"location": {{ job.location| jsonify }},
9+
"url": "{{ job.url }}"
10+
}{% if forloop.last %}{% else %},{% endif %}{% endif %}
11+
{% endfor %}{}]

pages/api/member-counts.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
layout: none
3+
permalink: /api/member-counts.json
4+
---
5+
{% assign member_counts = site.data.memberCounts | sort: "Total" | reverse %}[{% for entry in member_counts %}{
6+
"date": "{{ entry.Date }}",
7+
"count": "{{ entry.Total }}"
8+
}{% if forloop.last %}{% else %},{% endif %}
9+
{% endfor %}]

pages/feeds/jobs.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
layout: null
3+
permalink: /feeds/jobs.xml
4+
---
5+
{% assign sorted_jobs = site.data.jobs | sort: "posted" | reverse %}<?xml version="1.0" encoding="UTF-8"?>
6+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
7+
<channel>
8+
<title>{{ site.title | xml_escape }} Jobs</title>
9+
<description>{{ site.description | xml_escape }}</description>
10+
<link>{{ site.domain }}/jobs/</link>
11+
<atom:link href="{{ site.baseurl }}/feeds/jobs.xml" rel="self" type="application/rss+xml" />
12+
{% for job in sorted_jobs limit:100 %}{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %}{% capture expires %}{{ job.expires | date: '%s'}}{% endcapture %}{% capture posted %}{{ job.posted | date: '%b %d, %Y'}}{% endcapture %}{% if expires > nowunix %}<item>
13+
<title>{{ job.name | xml_escape }}</title>
14+
<description>
15+
Location: {{ job.location | xml_escape }}{% if posted %}, posted {{ posted | xml_escape }}{% endif %}
16+
</description>
17+
<link>{{ job.url | xml_escape }}</link>
18+
</item>
19+
{% endif %}{% endfor %}
20+
</channel>
21+
</rss>

pages/feeds/member-counts.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: null
3+
permalink: /feeds/member-counts.xml
4+
---
5+
{% assign member_counts = site.data.memberCounts | sort: "Total" | reverse %}<?xml version="1.0" encoding="UTF-8"?>
6+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
7+
<channel>
8+
<title>{{ site.title | xml_escape }} Member Counts</title>
9+
<description>{{ site.description | xml_escape }}</description>
10+
<link>{{ site.domain }}/join/</link>
11+
<atom:link href="{{ site.baseurl }}/feeds/member-counts.xml" rel="self" type="application/rss+xml" />
12+
{% for entry in member_counts %}<item>
13+
<title>Member Counts for {{ entry.Date }}</title>
14+
<description>Member count for {{ entry.Date }} is {{ entry.Total }}</description>
15+
<link>{{ site.domain }}/join</link>
16+
</item>
17+
{% endfor %}
18+
</channel>
19+
</rss>

pages/wg/website.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ For each RSS feed, we provide the latest 100 items.
2828
- [https://us-rse.org/feed.xml](https://us-rse.org/feed.xml): subscribe to posts on the US-RSE site
2929
- [https://us-rse.org/feeds/events.xml](https://us-rse.org/feeds/events.xml): subscribe to all US-RSE events.
3030
- [https://us-rse.org/feeds/newsletters.xml](https://us-rse.org/feeds/newsletters.xml): subscribe to a subset of newsletter posts
31-
- [https://us-rse.org/feeds/dei.xml](https://us-rse.org/feeds/del.xml): subscribe to DEI working group events
31+
- [https://us-rse.org/feeds/dei.xml](https://us-rse.org/feeds/dei.xml): subscribe to DEI working group events
32+
- [https://us-rse.org/feeds/jobs.xml](https://us-rse.org/feeds/jobs.xml): subscribe to latest non-expired jobs
33+
- [https://us-rse.org/feeds/member-counts.xml](https://us-rse.org/feeds/member-counts.xml): subscribe to monthly member total counts
3234

3335
### Json Feeds:
3436

@@ -38,5 +40,7 @@ JSON feeds are not limited in number, and we can provide this until a single pag
3840
- [https://us-rse.org/api/events.json](https://us-rse.org/api/events.json): json list of US-RSE events
3941
- [https://us-rse.org/api/newsletters.json](https://us-rse.org/api/posts.json): json list of US-RSE newsletters
4042
- [https://us-rse.org/api/dei.json](https://us-rse.org/api/dei.json): json list of dei events
43+
- [https://us-rse.org/api/jobs.json](https://us-rse.org/api/jobs.json): json list of non-expired jobs
44+
- [https://us-rse.org/api/member-counts.json](https://us-rse.org/api/member-counts.json): json list of monthly membership total count
4145

4246
If you are looking for a feed that does not exist, please [let us know](https://github.com/USRSE/usrse.github.io/issues).

0 commit comments

Comments
 (0)