<commit_before>#!/usr/bin/env python

import requests
import time
url = 'http://nogales/rock/receive.py'

points = [ 
	{ 'lon': "-104.932838", 'lat': "39.597551", 'speed': 5, 'course': 12 },
	{ 'lon': "-104.932823", 'lat': "39.598514", 'speed': 5, 'course': 2 },
  { 'lon': "-104.932373", 'lat': "39.599715", 'speed': 5, 'course': 2 },
  { 'lon': "-104.932359", 'lat': "39.601095", 'speed': 5, 'course': 46 },
  { 'lon': "-104.930727", 'lat': "39.600901", 'speed': 5, 'course': 73 }
]

momsn = 0

for p in points:
	time.sleep(3)
	# split into integer/fractional parts
	lat = p['lat'].split('.')
	lon = p['lon'].split('.')
	# N decimal digits
	lat[1] = lat[1][:5]
	lat[1] = lat[1][:5]
	# put data back together, don't include '.' for lat/lon
	mydata = '%s%s,%s%s,%s,%s' % (lat[0], lat[1], lon[0], lon[1], p['speed'], p['course'])
	print mydata
	message = {
		'imei': '300234010753370',
		'momsn': '12345',
		'transmit_time': '12-10-10 10:41:50',
		'iridium_latitude': '%s.%s'%(lat[0], lat[1][:4]),
		'iridium_longitude': '%s.%s'%(lon[0], lon[1][:4]),
		'iridium_cep': '8',
		'data': mydata.encode('hex')
	}
	print message

# POST with form-encoded data
#r = requests.post(url, data=message)

# Response, status etc
#print r.text, r.status_code<commit_msg>re-enabled post, executed per point, fixed longitude formatting trunctation<commit_after>#!/usr/bin/env python

import requests
import time
url = 'http://nogales/rock/receive.py'

points = [ 
	{ 'lon': "-104.932838", 'lat': "39.597550", 'speed': 5, 'course': 12 },
	{ 'lon': "-104.932823", 'lat': "39.598514", 'speed': 5, 'course': 2 },
  { 'lon': "-104.932373", 'lat': "39.599715", 'speed': 5, 'course': 2 },
  { 'lon': "-104.932359", 'lat': "39.601095", 'speed': 5, 'course': 46 },
  { 'lon': "-104.930727", 'lat': "39.600900", 'speed': 5, 'course': 73 }
]

momsn = 0

for p in points:
	time.sleep(3)
	# split into integer/fractional parts
	lat = p['lat'].split('.')
	lon = p['lon'].split('.')
	# N decimal digits
	lat[1] = lat[1][:5]
	lon[1] = lon[1][:5]
	# put data back together, don't include '.' for lat/lon
	mydata = '%s%s,%s%s,%s,%s' % (lat[0], lat[1], lon[0], lon[1], p['speed'], p['course'])
	print mydata
	message = {
		'imei': '300234010753370',
		'momsn': '12345',
		'transmit_time': '12-10-10 10:41:50',
		'iridium_latitude': '%s.%s'%(lat[0], lat[1][:4]),
		'iridium_longitude': '%s.%s'%(lon[0], lon[1][:4]),
		'iridium_cep': '8',
		'data': mydata.encode('hex')
	}
	print message
	# POST with form-encoded data
	r = requests.post(url, data=message)
	# Response, status etc
	print r.text, r.status_code
{'fraction_non_alphanumeric': 0.25486381322957197, 'fraction_numerical': 0.11595330739299611, 'mean_word_length': 4.35625, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '29688', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1092, 'n_words': 251}