How about somethingAs mentioned by lsimmons your code repeats the same logic. Therefore you could abstract this into a method and call it twice.
You also have some variables overriding names in the standard library ie, date
, time
. Naming like this? can lead to some hard to track bugs.
In addition you can remove the camel cased varaible names as this is not what standard styling defined here.
The class, although not needed, groups everything and keeps it clean. Plus if you ever have to use this data in other methods you don't have to have 6 args.
As your code gets more sophisticated you can decouple the parsing logic so you could use the same grouping code for multiple sites.
Here's some code that attempts the changes that might be helpful:
The class, although not needed, groups everything and keeps it clean. Plus if you ever have to use this data in other methods you don't have to have 6 args.
As your code gets more sophisticated you can decouple the parsing logic so you could use the same grouping code for multiple sites.