Is there any automated way of populating a Moodle training from a GitHub repository? - github

Moodle is a platform for creating training and educational material. By default, it is possible to make the content by clicking on controls.
GitHub is a place for version management and teamwork.
Question: I wondered if there is a way to (programmatically) populate/update a Moodle training from a GitHub repository. Does Moodle offer an API that would allow the implementation of such a functionality?
Idea:
The GitHub repository contains mark-down files in a specific format and folder structure.

Yes. Theoretically. Moodle offers an API (https://docs.moodle.org/dev/Web_service_API_functions) through which you can update courses along with much other functionality.
You would have to write the script yourself, of course. I've been briefly looking in to this as well, but the moodle webservice API is not intuitive and is underdocumented. There's been talk of making a more sensible, RESTful API (https://tracker.moodle.org/browse/MDL-49607) but it doesn't seem to have gotten anywhere.

Related

How to set repository's social media preview via Github API?

I am working on a project where I want to set the social media preview for multiple (lots of repositories) I own. I know there is a manual way to do it as mentioned here.
I was wondering if there was some way to do it via Github API or what kind of scripting could automate the task for adding social previews to multiple repositories.
If it was doable via the API, it'd almost certainly be one of the parameters at https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#update-a-repository. It's not there as of the time of this writing, but maybe someday.
There's sort of a feature request at https://github.com/orgs/community/discussions/32166. It's unclear if there's a better place to make an API feature request.

Fetch all metadata of Salesforce

I've been trying to implement a way to download all the changes made by a particular user in salesforce using PowerShell script & create a package The changes could be anything whether it can be added or modified, Apex classes, profiles, Account, etc based on the modified by the user, component ID, timestamp, etc. below is the URL that exposes the API. The URL Does not explain any way to do this by using a script.
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_listmetadata.htm
Does anyone know how I can implement this?
Regards,
Kramer
Salesforce orgs other than scratch orgs do not currently provide source tracking, which makes it possible to pinpoint user changes in metadata and extract only those changes. This is done by an SFDX/Metadata API client, like Salesforce DX or CumulusCI (disclaimer: I'm on the CumulusCI team).
I would not try to implement a Metadata API client in PowerShell; instead, harness one of the existing tools to do so.
Salesforce orgs other than scratch orgs don't provide source tracking at present. To identify user changes, you can either
Attempt to extract all metadata and diff it against your version control, which is considerably harder than it sounds and is implemented by a variety of commercial DevOps tools for Salesforce (GearSet, Copado, etc).
Have the user manually add components to a Change Set or Unmanaged Package, and use a Metadata API client as above to retrieve the contents of that package. (Little-known fact, a Change Set can be retrieved as a package!)
To emphasize: DevOps on Salesforce does not work like other platforms. Working on the Metadata API requires a fair amount of time investment and specialization. Harness the existing work of the Salesforce community where you can, but be aware that the task you are laying out may be rather more involved than you think and it's not necessarily something you can just throw together from off-the-shelf components.

Is there a way to retrieve Github repositories whose language has been changed?

I am trying to get all repositories whose language was Java but had changed to Kotlin and vice versa.
Does anyone know if it's possible to filter these repositories with the Github api?
If you are looking to compare before/after, in terms of a programming languages for particular GitHub repos, I'm not sure you can do that short of having a big-data project.
If you want to filter GitHub repos by programming language, the GitHub API documentation states:
Suppose you want to search for popular Tetris repositories written in Assembly. Your query might look like this.
curl https://api.github.com/search/repositories?q=tetris+language:assembly&sort=stars&order=desc
Also,
Checkout my open-soure project Git-Captain, which may help you.
It's an open-source web-application built with Node.js utilizing GitHub API to find, create, and delete a branch throughout numerous GitHub repositories.
Can be setup for organizations or a single user.
I have a step-by-step how to set it up on a server to communicate with the GitHub API.

Change CKAN API Interface - are there limitations on the API?

I've looked around the site to see if there are any people who have changed the CKAN API interface so that instead of uploading documents and databases, they can directly type onto the site, but I haven't found any use cases.
Currently, we have a page where people upload data sets through excel forms that they've filled out, but we want to make it a bit more user friendly by changing the API so that they can fill out a form on the page rather than downloading the template, filling it out and then uploading it.
Does CKAN have the ability to support this? If so, are there any examples or use cases of websites that have use forms rather than uploads?
This is certainly possible.
I'm not aware of any existing extensions that provide that functionality, but you can check the official list of CKAN extensions if there's anything that fulfills your needs.
If there is no existing extension that suits you then you could write your own, see the extension guide for details on how to do that.
Adding an API function to CKAN's API is possible, but probably not what you want in this case: the web UI usually does not interact with CKAN via the API but via Flask/Pylons controllers. Hence, you would add your add controller which first serves your form and then processes the submitted inputs.
You can take a look at the ckanext-pages extension, which does exactly that (for editing static pages instead of datasets, but your code would be similar).

Which Framework or CMS for Google-Video like site?

I am working on a Web Project similar to Google-Video.
As for now, I want to start coding the site.
I know some PHP, HTML and MySQL.
I already have:
Database built and ready (in MySQL)
Links and Tags in the Database
The thing is, I don't want to code everything from hand.
As I've seen so far, with CMS it's not possible to use my own database. Or am I wrong?
And what Framework would you suggest me?
Looking forward for your advice!
Thanks
You should probably start over, but use your existing DB design as your logical schema to be implemented in the CMS you eventually choose.
Go to http://cmsmatrix.org/ and compare Drupal, Joomla!, eZ Publish and TYPO3 for the best fit for your requirements.
Also, pay attention to the search engine features available with each one. e.g. eZ Publish eZ Find is based on Lucene.
In terms of functionality ( but excluding add management and your specific layout or graphic-design) you should be able to create a reasonable clone within a few hours using eZ. Here is one example http://untoldstories.eu/ezinfo/about