use webstorm to split single declarations into multiple declarations - this is simply a style preference
remove duplicate declaration!
remove unused code
add some more tests so I can refactor more :)
merge declaration and initialization
getting postId via data-pid attribute is either new or it was always there and is less code to get the job done
remove useless  comment
move declaration closer to first usage
now that we don't need the url to get the postId, let's move that closer to our only usage
inline title and url - personal opinion and be careful doing this if it's a confusing assignment process
consider extracting some methods for readability