  The Painleve and weak Painleve conjectures have been used widely to identify
new integrable nonlinear dynamical systems. The calculation of the integrals
relies though on methods quite independent from Painlev\'e analysis. This paper
proposes a new explicit algorithm to build the first integrals of a given set
of nonlinear ordinary differential equations by exploiting the information
provided by the Painleve - Laurent series representing the solution in the
neighbourhood of a movable singularity. The algorithm is based on known
theorems from the theory of singularity analysis. Examples are given of the
explicit construction of the first integrals in nonlinear Hamiltonian dynamical
systems with a polynomial potential, and in generalized Volterra systems.
