
Recherche avancée
Médias (91)
-
Spoon - Revenge !
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
My Morning Jacket - One Big Holiday
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Zap Mama - Wadidyusay ?
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
David Byrne - My Fair Lady
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Beastie Boys - Now Get Busy
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
Autres articles (83)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (5847)
-
Include a picture to audio file use CLI [on hold]
20 mars 2016, par LXYi want to use something which can include pic file to an exist audio file. i tried using ffmpeg but the result seems like it can’t do that
Then i used Foobar2k and it included the picture as cover successfully but it have no CLI and i want to use Linux app
So how could i do this ?
Sorry for my terrible English
Just insert a cover art image into an exist ogg file.
The format of picture should be png or jpg
Thanks for help -
MP3 + JPG of same name
23 avril 2016, par user6162407For every mp3 file in my folder I have a certain jpg file with the same name, what I’m trying to achieve with cmd is making that name into one variable name without the file extension
This is my code using only a mp3 name
for %%a in ("*.mp3") do ffmpeg -i "%%a.mp3" -loop 1 -i Cover.jpg -c:v libx264 -tune stillimage -c:a aac -strict experimental -b:a 320k -pix_fmt yuv420p -vf scale=3000:3000 -shortest "%%~na.mp4"
-
Track API calls in Node.js with Piwik
When using Piwik for analytics, sometimes you don’t want to track only your website’s visitors. Especially as modern web services usually offer RESTful APIs, why not use Piwik to track those requests as well ? It really gives you a more accurate view on how users interact with your services : In which ways do your clients use your APIs compared to your website ? Which of your services are used the most ? And what kind of tools are consuming your API ?
If you’re using Node.js as your application platform, you can use piwik-tracker. It’s a lightweight wrapper for Piwik’s own Tracking HTTP API, which helps you tracking your requests.
First, start with installing
piwik-tracker
as a dependency for your project :npm install piwik-tracker --save
Then create a new tracking instance with your Piwik URL and the site ID of the project you want to track. As Piwik requires a fully qualified URL for analytics, add it in front of the actual request URL.
var PiwikTracker = require('piwik-tracker');
// Initialize with your site ID and Piwik URL
var piwik = new PiwikTracker(1, 'http://mywebsite.com/piwik.php');
// Piwik works with absolute URLs, so you have to provide protocol and hostname
var baseUrl = 'http://example.com';
// Track a request URL:
piwik.track(baseUrl + req.url);Of cause you can do more than only tracking simple URLs : All parameters offered by Piwik’s Tracking HTTP API Reference are supported, this also includes custom variables. During Piwik API calls, those are referenced as JSON string, so for better readability, you should use
JSON.stringify({})
instead of manual encoding.piwik.track({
// The full request URL
url: baseUrl + req.url,
// This will be shown as title in your Piwik backend
action_name: 'API call',
// User agent and language settings of the client
ua: req.header('User-Agent'),
lang: req.header('Accept-Language'),
// Custom request variables
cvar: JSON.stringify({
'1': ['API version', 'v1'],
'2': ['HTTP method', req.method]
})
});As you can see, you can pass along arbitrary fields of a Node.js request object like HTTP header fields, status code or request method (GET, POST, PUT, etc.) as well. That should already cover most of your needs.
But so far, all requests have been tracked with the IP/hostname of your Node.js application. If you also want the API user’s IP to show up in your analytics data, you have to override Piwik’s default setting, which requires your secret Piwik token :
function getRemoteAddr(req) {
if (req.ip) return req.ip;
if (req._remoteAddress) return req._remoteAddress;
var sock = req.socket;
if (sock.socket) return sock.socket.remoteAddress;
return sock.remoteAddress;
}
piwik.track({
// …
token_auth: '<YOUR SECRET API TOKEN>',
cip: getRemoteAddr(req)
});As we have now collected all the values that we wanted to track, we’re basically done. But if you’re using Express or restify for your backend, we can still go one step further and put all of this together into a custom middleware, which makes tracking requests even easier.
First we start off with the basic code of our new middleware and save it as
lib/express-piwik-tracker.js
:// ./lib/express-piwik-tracker.js
var PiwikTracker = require('piwik-tracker');
function getRemoteAddr(req) {
if (req.ip) return req.ip;
if (req._remoteAddress) return req._remoteAddress;
var sock = req.socket;
if (sock.socket) return sock.socket.remoteAddress;
return sock.remoteAddress;
}
exports = module.exports = function analytics(options) {
var piwik = new PiwikTracker(options.siteId, options.piwikUrl);
return function track(req, res, next) {
piwik.track({
url: options.baseUrl + req.url,
action_name: 'API call',
ua: req.header('User-Agent'),
lang: req.header('Accept-Language'),
cvar: JSON.stringify({
'1': ['API version', 'v1'],
'2': ['HTTP method', req.method]
}),
token_auth: options.piwikToken,
cip: getRemoteAddr(req)
});
next();
}
}Now to use it in our application, we initialize it in our main
app.js
file :// app.js
var express = require('express'),
piwikTracker = require('./lib/express-piwik-tracker.js'),
app = express();
// This tracks ALL requests to your Express application
app.use(piwikTracker({
siteId : 1,
piwikUrl : 'http://mywebsite.com/piwik.php',
baseUrl : 'http://example.com',
piwikToken: '<YOUR SECRET API TOKEN>'
}));This will now track each request going to every URL of your API. If you want to limit tracking to a certain path, you can also attach it to a single route instead :
var tracker = piwikTracker({
siteId : 1,
piwikUrl : 'http://mywebsite.com/piwik.php',
baseUrl : 'http://example.com',
piwikToken: '<YOUR SECRET API TOKEN>'
});
router.get('/only/track/me', tracker, function(req, res) {
// Your code that handles the route and responds to the request
});And that’s everything you need to track your API users alongside your regular website users.