JamesMarcogliese / SMS-Info-System

SMS Information System (SIS)
2 stars 2 forks source link

Text formatting #11

Open Ibadullah-Usmani opened 7 years ago

Ibadullah-Usmani commented 7 years ago

Seems like each API may have to undergo different text formatting styles

Places API:

The output string consists of 3 possibilities, one possibility is a string saying 'no results found'. Second possibility, each result can have 3 variables(lines) as output if the user has inputted place_type or third possibility, each result can have 5 variables (lines) if user has inputted a place_name. So need to figure out how system will send the texts; do we send each text separately or merge 2-3 lines at a time (while still checking for 160 character count as part of validation)?

Directions API:

A step can potentially be 160+ characters long, so each line must be sent as a separate text as a precaution (while still checking for 160 character count as part of validation)

JamesMarcogliese commented 7 years ago

Just for consideration: It would be beneficial in terms of speed to have as much text in a smstext as possible since each sent smstext takes 4 seconds minimum regardless of characters.

shgaurav commented 7 years ago

@JamesMarcogliese I am working on this issue. I have managed to split results for weather api. Right now the api returns current weather and 3 days forecast. Thus, It makes sense to split current weather in one message and the 3 day forecast in another. For now, I am able to split by using a slash and then doing a split. This method works for weather api. However, with api's that use a loop to iterate and merge data variables. The slash method does not work as of yet. This is simply because the final string ends up having multiple slashes depending on how many times the for loop iterates. I will be trying to see if i can count and split depending on how many slashes are available in the result string. If (slash ==3) then split into 3 different variables. This method will only work if one places result or 1 step fits in one message. If lets say details about a single place goes over 160 character issue. It would split again which makes this whole process irrelevant.