There are many pedometers algorithms out there, they basically take in the accelerometer values, find any patterns and add steps
I would give it a jab although I don't have access to ny PC right now, if this question doesn't get answered tommorow, I'll give it a go.
Edit: I did some digging around, it seems that implementing a pedometet yourself would be a huge headache, you'd need data, so that means plotting graphs of accelerometer values, finding a pattern for steps in multiple conditions and designing an algorithm around that data pattern. Waste of time. The best you can do is basically write a plugin around a popular js pedometer library and hope for the best