It is well known that calculations of the entries of the stiffness matrix in the finite element approximations of nonlocal diffusion and mechanics models are often very time-consuming due to the double integration process over the domain and the singularities of the nonlocal kernel functions. In this paper, we propose some effective and accurate quadrature rules for computing these double integrals for one-dimensional nonlocal problems; in particular, for problems with highly singular kernels, the corresponding inner integrals can be first evaluated exactly in our method, and the outer one then will be approximated by some popular quadrature rules. With these quadrature rules, the assembly of the stiffness matrix in the finite element method for the nonlocal problems becomes similar to that for the classical partial differential equations and is thus quite efficient.