https://github.com/gcyrillus/apipluxml
Ebauche d'une API pour le CMS PluXml
https://github.com/gcyrillus/apipluxml
api json plugin pluxml
Last synced: about 2 months ago
JSON representation
Ebauche d'une API pour le CMS PluXml
- Host: GitHub
- URL: https://github.com/gcyrillus/apipluxml
- Owner: gcyrillus
- Created: 2024-02-16T18:03:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T13:35:24.000Z (over 2 years ago)
- Last Synced: 2025-08-10T15:45:20.226Z (11 months ago)
- Topics: api, json, plugin, pluxml
- Language: PHP
- Homepage:
- Size: 134 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.txt
Awesome Lists containing this project
README
# ApiPluXml
Ebauche d'une API pour le CMS PluXml
Extraction de données depuis PluXml renvoyées au format json
Exemple
Affiche une liste de lien des pages statiques d'un site PluXml distant.
Depuis un site en http interrogeant un site en https : http => https
Depuis un site en http interrogeant un site en http : http => http
Depuis un site en https interrogeant un site en https : https => https
Depuis un site en https interrogeant un site en http : ce cas de figure ne fonctionne pas pour des raisons de sécurité . http ne renvoit pas de réponse cryptées vers un site https aux echanges sécurisés.
Code à inserer dans le corps HTML de votre page
<div id="results"></div>
/*/Config/*/
// Votre clé
const apiKey = 'apiPluXml';
// protocol HTTP du site (preference https (connexion sécurisé)| http non garantie )
// connexion https => https : OK | connexion http => http OK | connexions https => http BLOCKED ! | http => https OK
const ProtocolHTTP = 'https';/* or http */
// nom du domaine de l'API suivit d'un / et d'un ? si l'url rewriting n'est pas activé sur le site OluXml distant.
const apiPluXmlSite = 'pluxthemes.com/';/* exemple: 'pluxopolis.net/crashnewstest/' ou 'pluxthemes.com/?' */
// nombre d'article par page
const apibypage=''; /* rien = la config du site distant */
// afficher l'article en entier ?
let artcontent= false ; /* pour voir tout l'article : mettre a true */
/*/End Config/*/
// Création et appel du fichier javascript distant.
let scpt = document.createElement('script');
scpt.setAttribute('id','apiCall');
scpt.setAttribute('async','');
scpt.setAttribute('src', ProtocolHTTP+'://'+apiPluXmlSite.replace(/\?$/, '')+'plugins/ApiPluXml/js/apiCalling.js');
document.querySelector('#results').appendChild(scpt);
var script = document.querySelector('#apiCall');
script.addEventListener('load', function() {
////fonctions d'appels et d'affichage html
//========================================
// getPlxApiResult(apiPluXmlSite+'apiPluxml') ; // aide descriptif
// getPlxApiResult(apiPluXmlSite+'apiPluxml&static','static') ;
getPlxApiResult(apiPluXmlSite+'apiPluxml&article&page_number=1&bypage=5','article') ;
// getPlxApiResult(apiPluXmlSite+'apiPluxml&categorie','categorie') ;
// getPlxApiResult(apiPluXmlSite+'apiPluxml&etiquette','etiquette') ;
////fonction d'appels , retourne un objet json
//============================================
// getPlxApiResult(apiPluXmlSite+apiPluxml&commentaires','commentaires')
// getPlxApiResult(apiPluXmlSite+apiPluxml&authors','authors')
//// (dé)commenter les lignes necessaires
});